Work Item Command Line 5.0


I just published the Work Item Command Line (WCL) version 5.0. In this post, I will provide a short summary of the changes that went in.

Download and License

The work item command line is provided as is, with no warranty or support, under MIT license. The source code is provided here.

In addition to the source code I usually create releases that contain a zip file with WCL pre built and ready to use. Please note that some of the commands require additional libraries that are not packaged due to license concerns. Read the readme file contained in the WCL folder for how to get the libraries. This is the WCL 5.0 release.

Compatibility

Please note that the current WCL 5.0 is built and tested for RTC 6.0.x. It should be possible to use WCL against older versions of RTC, but that requires some modifications to deal with some small API and packaging changes for RTC 6.0.x. Please see this post for some information about what needs to be done.

Changes

The changes between WCL 4.3 and WCL 5.0 are as follows.

  • A new command -bulkupdate has been added that allows to perform an update for all work items returned by a query. All qualified work items will be updated with the values provided. The values can be provided with the same syntax used in the command -update.
  • It is now possible to delete all attachments of a work item. Use the pseudo attribute @deleteAttachments with required value “yes“.
  • It is now possible to delete all links of a linktype from a work item. Use the pseudo attribute @deleteLinks_linktype with required value “yes“.
  • Timestamps/Date values can now be set to unassigned.
  • WCL registers itself as potentially resource intensive scenario. This information is available in the RTC server as MBean and can be queried and displayed.
  • Work item resolution values are now correctly exported as display value and not as resolution ID.
  • Work item resolution values are now correctly imported. WCL detects the value to set for a resolution from the display name and the ID.
  • The command -importworkitems now handles empty column values for the attributes where it makes sense. An empty column value will overwrite an attribute value and remove it. In previous versions the import ignored empty values. Not all attributes can be set to an empty value. Categories, for example, have to always be set using a category value. Use the switch /ignoreemptycolumnvalues to switch back to the old behavior ignoring empty columns.
  • The command -importworkitems does no longer attempt to write attributes that can not be set and only displays a warning. Examples are the creator, the creation date and other values managed by RTC.
  • The command -importworkitems handles some new pseudo attributes such as e-signature gracefully by warning that they are not supported.
  • The export and print work item commands order the column output alphabetically if no special column order is specified.
  • Minor bug fixes.

Changes are also mentioned in the releases.

Summary

WCL has come to a point where it does pretty much all I wanted it to do in the inception phase. I hope it helps users out there. Some feedback who uses it and against which version would be helpful.

Advertisement

28 thoughts on “Work Item Command Line 5.0

  1. Hi Ralph,
    I’m trying to transfer workitems with attachments (wcl 5.1.1, import into RTC 6.0.6.1):
    The -exportworkitems provides a column “Attachments” with following value “./Attachments/278343/SampleLine.png,SampleLine.png,image/png,UTF-8” (which corresponds to the form “SomeFilePath,Some Description,ContentTypeID,EncodingID”.
    But the -importworkitems creates out of this two identical attachments with same name.

    Bug or do I miss something?

    regards,
    Donat

      • thanks .. will try to dig into this in the development environment. Will inform you if I get the root cause.

      • Import works well.
        The issue with duplicated attachments is due to the fact, that the command -exportworkitems with switch /allColumns provides in my environment 2 “Attachments” columns with same information.

      • I would suggest to specify the columns you want to export. I can’t filter pseudo attributes that are duplicates of other attributes.

  2. Does this work with PlainJava 6.0.6.1 I’m getting commandline errors below:

    StartTime: Sep 2, 2020 2:07:14 PM
    WorkItemCommandLine Version 5.3

    Starting Team Platform …
    Executing command: exportworkitems

    Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/commons/httpclient/Header
    at com.ibm.team.repository.transport.client.RemoteTeamServer.getHttp3ResponseHeaders(RemoteTeamServer.java:2089)
    …..

  3. I try to use WCL on Version 7 of Jazz, but experience following issue with adding attachments.
    In “WorkItemUpdateHelper.java”, method “attachFile”, the statement “CreateAttachment” on this line
    IAttachment newAttachment = getWorkItemClient().createAttachment(getWorkItem().getProjectArea(), file, description, contentType, encoding, fis, monitor);

    gives a server exception:
    CRJAZ2796E Details about the error were written to the server log file. java.lang.IllegalArgumentException: Item id and State id must not be null

    The IProjectAreaHandle has only itemId (UUID) property set, but stateId is null. Any idea how to solve this issue?
    Is this new behavior in Jazz version 7?

    regards,
    Donat

    • Can you please create an issue in the Git project with the details. Another user reported something similar but I can not reproduce it. Please provide details – Version of WCL, Version of EWM, What attachment, encoding? I have only very few time to look into something at the moment, the more hints, the better. Maybe even some details on the CSV and the folder structure you use.

      • In that particular case the user did not understand what the RMI mode was and how to use it. It was a user error. They did stop trying to use RMI mode and used the normal mode.

      • I am facing the same issue while adding an attachment for an item :
        Error : RmiOperationClient exception: Item id and State id must not be null CRJAZ2796E Details about the error were written to the server log file. To find this data, search the log file for this identifier: 5450E9C3BDA925A58348D133498259502CCA0266.$$$$

        java.lang.IllegalArgumentException: Item id and State id must not be null CRJAZ2796E Details about the error were written to the server log file. To find this data, search the log file for this identifier: 5450E9C3BDA925A58348D133498259502CCA0266.

  4. Hi Ralph,

    I need to add links of type Related Artifact with their labels. But I don’t think WCL handles the link labels. Can you confirm?

    Thank you!

      • The code is, for example, in

        com.ibm.js.team.workitem.commandline.helper.WorkItemUpdateHelper.createCLM_URI_References(ParameterValue, IEndPointDescriptor, List)

        Where I use

        reference = IReferenceFactory.INSTANCE.createReferenceFromURI(new URI(uri), uri);

        I always use the URI as the comment, because the parameter handling does not support specifying the URI.

        It would be a major change to modify the input parameters to support additional link labels.

      • You could use an unused character from these unsafe characters: “{“, “}”, “\”, “^”, “~”,
        “[“, “]”, and “`”. to encode the Label into the URI:
        @link_related_artifact=uri1|uri2|…

        E.g.
        @link_related_artifact=uri1^A label for the link|uri2^Another label for the link|uri3|…

        @link_related_artifact=https://server……/item/123^The Label I want|https://server……/item/155^Another Label|…

        and enhance com.ibm.js.team.workitem.commandline.helper.WorkItemUpdateHelper.createCLM_URI_References(ParameterValue, IEndPointDescriptor, List) to split the URI and the label using the separator ^ .

  5. Hi Ralph,

    I’m trying to get it working on Linux and windows with 6.0.6.1 client libs and JDK 1.8 (updates 121, 191 and 361). On both I get this error just simply running the wcl.bat or wcl.sh:

    Error: A JNI error has occurred, please check your installation and try again
    Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/logging/log4j/core/config/Configuration
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
    at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
    at java.lang.Class.getMethod0(Class.java:3018)
    at java.lang.Class.getMethod(Class.java:1784)
    at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
    Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.core.config.Configuration

    Appreciate any help!

    Thanks,
    Binoy

  6. Nevermind! I was using WCL 6 which is not compatible. Used WCL 5.3.1 (seems to be 5.x latest that support 6.0.6.1) and it works.

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 )

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.