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 (49713144139) | asked Nov 13 '13, 2:52 a.m.
edited Nov 13 '13, 2:53 a.m.

I am using the RTC CLI with RTC server version

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,


Ralph Schoon commented Nov 13 '13, 3:11 a.m. | edited 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

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.


One answer

permanent link
Shashikant Padur (4.2k27) | answered Nov 13 '13, 3:14 a.m.
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.

Andrew Trobec commented Nov 13 '13, 3:40 a.m.


Hello Shashikant,
Thank you for the reply.  I am using RTC but the -j or --json options aren't available as described in this document:  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!

Ralph Schoon commented Nov 13 '13, 3:46 a.m.

Andrew, you should be able to use lscm on windows too. See

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.

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.