How do I use the RTC CLI to automatically associate a change set to a work item via checkin?
Hello,
Does the scm checkin command return the id of the changeset that I can catch and then use for the scm changeset associate command? How do I automate these two steps into a single step?
I am using the RTC CLI with RTC server version 4.0.0.1.
What I would like to do is check-in a file to a repository workspace and automatically have that changeset be associated to a work item. The CLI command to associate a changeset is scm changeset associate (changeset id) (work item id). I already know the work item id, but the changeset id is only created during the check-in process.
Does the scm checkin command return the id of the changeset that I can catch and then use for the scm changeset associate command? How do I automate these two steps into a single step?
Thank you and best regards,
Andrew
One answer
The checkin command output shows the change set(s) that the file(s) were checked into. To display the UUID of the change set, run 'scm -u y checkin ....'. If you are doing this in the script, you should run 'scm checkin --json ....' to display the output in json format and parse that output rather than plain text output. I believe --json option to commands was introduced in 4.0.
Comments
Hello Shashikant,
Thank you for the reply. I am using RTC 4.0.0.1 but the -j or --json options aren't available as described in this document: https://jazz.net/library/article/1031. I am using scm and not lscm since I working with windows.
The output from the checkin can be stored and parsed, so that's what I'll have to do.
Thank you!
Andrew
Andrew, you should be able to use lscm on windows too. See http://pic.dhe.ibm.com/infocenter/clmhelp/v4r0/topic/com.ibm.team.scm.doc/topics/c_scm_cli.html
Note: For improved performance, you can run the command line using lscm.bat or lscm. This lightweight command line version creates a daemon process on your machine that reduces the startup time and improves the execution time for most commands. You might need to replace the JAVA variable in these scripts to point towards the java that you run on your machine. You can also launch a daemon process manually by running the scm daemon start. For more information, see daemon_start.html
Andrew, the document you referred to says that -j/--json option is supported in 4.0. Can you run 'scm help checkin' and see if the --json option is listed?
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Nov 13 '13, 3:41 a.m.I should have read your whole question ..... My apologies.
However, the links below could be useful to others, so I will leave them there....
According the product documentation/help
http://pic.dhe.ibm.com/infocenter/clmhelp/v4r0/topic/com.ibm.team.scm.doc/topics/changeset_associate.html
changeset associate does the trick.
Please note with 4.0.5 there is a consolidation of the CLI and the commands are more systematic. The new command will be SCM add workitem.
See https://jazz.net/help-dev/clm/topic/com.ibm.team.scm.doc/topics/add_workitem.html