How to capture RTC change set id automatically via SCM CLI
anoop mc (748●11●200●221)
| asked Oct 05 '17, 2:40 a.m.
retagged Oct 06 '17, 3:59 p.m. by Ken Tessier (841●1●7) Hi,
We are using SCM CLI for creating work spaces, check in, deliver etc.
When ever we do a check action a unique change set id will be generated.
How to capture the new change set id automatically.
Here each time we need to run the command scm show status then capture the change set id.
|
7 answers
Shashikant Padur (4.3k●2●7)
| answered Oct 05 '17, 4:48 a.m.
JAZZ DEVELOPER edited Oct 05 '17, 4:49 a.m. When you run the checkin command use the -j/--json option. Post that you can parse the json output to retrieve the new change set id. Comments
anoop mc
commented Oct 05 '17, 11:10 a.m.
will try out and see how it goes
anoop mc
commented Oct 07 '17, 1:33 p.m.
Here is your article which talks about the same.
|
'outgoing-changes' contains the list of change sets and each change sets have list of changes. In your case the change set id is listed in the following path:
{
"workspaces": [
{
"components": [
{
...
"outgoing-changes": [
{
...
"uuid": "_fh_8oKwMEeewLNKffOsvgQ"
}
],
}
],
}
]
}
Comments
anoop mc
commented Oct 09 '17, 2:34 a.m.
./scm.sh add wi "_fh_8oKwMEeewLNKffOsvgQ" 10565 Link created. This worked.
anoop mc
commented Oct 09 '17, 6:02 a.m.
What do you suggest here to capture the change_set automatically upon each check in.
suppose if we create a variable it should look inside the JSON script for what type and how it can determine the change-set UUID
anoop mc
commented Oct 11 '17, 9:54 a.m.
change-set UUID will be stored inside this object value pair
['workspaces'][0]['components'][0]['outgoing-changes'][0]['uuid'])
|
Hi,
Comments
anoop mc
commented Oct 05 '17, 11:09 a.m.
upon each check-in action a new change set id will get generated. Not sure how the above solution will help |
Finally we were able to achieve close to our requirement.
Sharing those information as it might be useful for someone.
./scm.sh checkin ledger.jar
./scm.sh status -j > /root/jazz/smtools/eclipse/data.json (Here you are directing the JSON output of the command using -j parameter to a file called data.json)
Note: Once you got the data inside the data.json file - the change-set UUID will be stored inside this object value pair
['workspaces'][0]['components'][0]['outgoing-changes'][0]['uuid'])
changeset=
/usr/bin/python /root/jazz/scmtools/eclipse/script.py (have written a python script which refer to the object value - ['workspaces'][0]['components'][0]['outgoing-changes'][0]['uuid'] and capture the UUID of outgoing change-set) and capture the UUID of outgoing changeset
echo $changeset (displaying the output of the variable)
./scm.sh add wi "$changeset" <work item ID> (Now we were able to substitute the change-set value with a variable called $changeset)
./scm.sh deliver --source userWorkspace1 --target "ABC_DEVOPS_SCM Stream" (Finally you can try to deliver)
This helped us to capture the RTC change-set ID automatically and deliver to the stream.
|
Now we came across a strange issue where the scm is not showing the status.
In the case above we are able to login, share files successfully, run check in command.
When running ./scm.sh status it not showing anything. Are we missing something.
Verified all the permissions all seem to be fine. Let me know if there is any workaround to this issue.
Comments
anoop mc
commented Oct 17 '17, 12:22 p.m.
In the above post you may see the same command was working fine for me. |
Look like this is due to permission issue in RTC. Last day when the user was given full rights in RTC SCM project area.
It started working again. Now that we are able to see the status command update.
./scm.sh status
./scm.sh show status
Workspace: (1005) "anoop_workspace1" <-> (1001) "ABC_Test_Stream"
Component: (1006) "Demo1"
Baseline: (1007) 1 "Initial Baseline"
Outgoing:
Change sets:
(1008) -*--@ "Share" 18-Oct-2017 09:36 AM
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.