A RTC WorkItem Command Line Version 2.1


In the last post Extending the WorkItem Command Line With New Commands we added a new command to the WorkItemCommandLine to implement a solution for attribute data migration as explained in Workaround: Migrate from Rational Team Concert 3.X string attribute used as multi-select lists to RTC 4.X enumeration lists.  Here is the updated source code.

Latest Version

See A RTC WorkItem Command Line Version 3.0 for the latest version.

What’s new?

This version of the RTC WorkItem Command Line has a new command that allows to migrate RTC 3.x multi-select enumeration data stored in string type attributes, containing Enumeration Literals separated by comma ‘,’ into the new EnumerationList attribute type.

Related posts

License

The post contains published code, so our lawyers reminded me to state that the code in this post is derived from examples from Jazz.net as well as the RTC SDK. The usage of code from that example source code is governed by this license. Therefore this code is governed by this license. I found a section relevant to source code at the and of the license.

Please also remember, as stated in the disclaimer, that this code comes with the usual lack of promise or guarantee.

On the other hand, you have the code and are able to add your own code to it. It would be nice to know what you did and how, if you do so.

Just Starting With Extending RTC?

If you just get started with extending Rational Team Concert, or create API based automation, start with the post Learning To Fly: Getting Started with the RTC Java API’s and follow the linked resources.

You should be able to use the code attached to this post in the development environment you set up in the Rational Team Concert Extensions Workshop and get your own extensions or automation working there as well.

Download

You can download the latest version here:

Setup

Follow the setup description in A RTC WorkItem Command Line Version 2

The Syntax of the new Command

WCL uses the following syntax for the new command:

wcl -migrateattribute {/ignoreErrors} repository=RepoitoryURI user=user password=password projectArea=ProjectAreaName workItemType=typeID { id=WorkItemID } sourceAttributeID=AttributeID targetAttributeID=AttributeID

Where the sourceAttributeID must be the ID of a work item attribute of any string type. The content must be Enumeration Literal ID’s, separated by comma stored by a RTC 3.x muti-select EnumerationList presentation. In RTC 3.x the attribute type used to store the enumeration literal ID’s was a small or medium string. The command only checks for any string.

The targetAttributeID must be the ID of a work item attribute of type EnumerationList, where the enumeration and thus the literal ID’s must match the enumeration used in the source attribute.

If the attribute types don’t match the required types or the finds literal ID’s that don’t match a literal in the target enumeration, the work item is not changed. The user requires the permission to read and write the work items.

The image below shows the source attribute as shown in RTC 4.x with a regular string presentation and the new EnumerationList attribute. The values from the source attribute have been migrated over to the target attribute.

Source and target attribute

Source and target attribute

Below are examples how to launch the WorkItem command Line. The first example runs the migration for all work item of a specific type in a project area.

wcl -migrateattribute /ignoreErrors repository="https://clm.example.com:9443/ccm" user=ralph password=ralph projectArea="JKE Banking (Change Management)" workItemType=task sourceAttributeID=custom.medium.string targetAttributeID=custom.enumeration.list

The second example is used for testing and only works on the work item with the specified ID.

wcl -migrateattribute /ignoreErrors repository="https://clm.example.com:9443/ccm" user=ralph password=ralph projectArea="JKE Banking (Change Management)" workItemType=task  id=275 sourceAttributeID=custom.medium.string targetAttributeID=custom.enumeration.list
Advertisements

About rsjazz

Hi, my name is Ralph. I work for IBM and help colleagues and customers with adopting the Jazz technologies.
This entry was posted in Jazz, RTC, RTC Automation and tagged , . Bookmark the permalink.

12 Responses to A RTC WorkItem Command Line Version 2.1

  1. Gabriel Lopez says:

    Hi Ralph. I assume this tool sets modified by and modified date, as normal.
    Do you know if there is a way we can do bulk modifications without setting it?

  2. Andy Jewell says:

    Very nice, this is extremely helpful. One thing, however, I’m unable to download the source project, it seems to be some sort of DNS or security error. I tried a couple of different ways, could you please confirm the download site is good?

  3. MANJU says:

    Hello Ralph,

    I am trying to print the workitem with custom printable format, i have written a server side plugin to get desire attribute values and it will create a .html file on server which has print functionality for custom printable format.
    Now the problem is i am not able to download or open that html file on client machine to print it.
    please help me with this.

    Thanks in advance

  4. Anthony Ennis says:

    Hi Ralf
    I am pulling my hair out with this one. I am trying to create task in rtc

    /usr/lib/jvm/java-8-openjdk-amd64/bin/java -Djava.security.policy=rmi_no.policy -Djava.ext.dirs=./lib:../plainjava:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext -cp ./lib:../plainjava% -jar wcl.jar -create /ignoreErrors repository=https://:8013/jazz user=****@ie.ibm.com password=***** workItemType=task category=”Tas Customer Implementation/Site Creation” projectArea=”Smarter Workforce” summary=xxx

    WorkItemCommandLine Version V3.2
    The jazz server is 6.1

    The error is

    Exception! Exception getting attribute representation: [category] Value: [Tas Customer Implementation/Site Creation] Original exception:
    Category not found: category Value: Tas Customer Implementation/Site Creation
    Ignored…….
    Work item not created. ‘Save Work Item’ failed. Preconditions have not been met: The ‘Filed Against’ attribute needs to be set (work item ).
    Failed!

    I have tried filedAgainst, Filed_Against, and Category, but all result in this error.

    Regards

    • rsjazz says:

      You can find the ID in the Web Admin UI. The official ID is category in /com.ibm.js.team.workitem.commandline/src/com/ibm/js/team/workitem/commandline/parameter/ParameterIDMapper.java there is a mapping and WCL also supports com.ibm.team.workitem.attribute.category and FILED_AGAINST..

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s