It's all about the answers!

Ask a question

How do I use the RTC CLI to automatically associate a change set to a work item via checkin?


Andrew Trobec (49712144139) | asked Nov 13 '13, 2:52 a.m.
edited Nov 13 '13, 2:53 a.m.
Hello,

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

Comments
Ralph Schoon commented Nov 13 '13, 3:11 a.m. | edited Nov 13 '13, 3:41 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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

One answer



permanent link
Shashikant Padur (4.2k27) | answered Nov 13 '13, 3:14 a.m.
JAZZ DEVELOPER
edited Nov 13 '13, 3:18 a.m.
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
Andrew Trobec commented Nov 13 '13, 3:40 a.m.

@spadur

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


Ralph Schoon commented Nov 13 '13, 3:46 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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


Shashikant Padur commented Nov 13 '13, 3:56 a.m.
JAZZ DEVELOPER

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?

Your answer


Register or to post 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.