Guideline: RTC Work Item Command Line
The RTC Work Item Command Line is a command line interface for accessing the work item capabilities of Rational Team Concert.
Relationships
Related Elements
Main Description

Note: This package is an example and delivered as is.

Introduction

The main capabilities supported are:

  1. Work Items: create, display, modify
  2. Run Queries

Command Syntax

Usage: rtcwi.py [options] subcommand

Options:

-v, --version

Print version information

-r REPOSITORY, --repository=REPOSITORY

Repository URL

-p PROJECT, --project=PROJECT

Project name

-u USER, --user=USER

Username

-n NICKNAME, --nickname=NICKNAME

Connection alias

-P PASSWORD, --password=PASSWORD

Password

-c, --cache

Caches password on prompt

-t WIFILE, --wifile=WIFILE

Name of a file that contains a work item description.

-a, --action=ACTION

Used on the modify command to specify what action (state change) to apply to the work item.

-x TRANSLATE, --translate=TRANSLATE

Translate internal values to display values. Options: yes, no, to, from

-e, --excludelists

Exclude Empty Lists

--config=CONFIG

Name of a file that contains a work item description.

-h, --help

Display help.

--noprompt

Don't ask for input

-V, --verbosity=LEVEL

How much to output: 0=nothing, 1=minimal, 2=normal,3=extra Setting verbosity to 0 will result in only error messages being emitted.

Available Subcommands:

CLEAR:

Removes configuration files.

help:

Display help. Optionally specify the subcommand to display help for.

list:

List information about categories, actions, etc... See help for more details.

create:

Create a work item

modify:

Modify a work item. Use with -a / --action option to change state of work item.

whoami:

Shows ID of user signed in to RTC

subscribe:

Subscribe yourself or other users to a work item.

listqueries:

List queries in the project area.

addcomment:

Add a comment to a work item.

runquery:

Run query.

unsubscribe:

Unsubscribe yourself from a work item.

setcwe:

Set the default values to use for repository and project.

login:

Login to the repository

unlink:

Remove a link from a work item.

display:

Displays a work item

link:

Add a link from one work item to another.

Configuration Options

The rtcwi command keeps information about configuration options and repository connections in a configuration directory. The configuration directory is put in a subdirectory named .rtcwicli in the user's home directory. This location can be changed by using the --config command line parameter.

The command can also be configure with the following environment variables. Here is the order of precedence for configuration options in order of highest precedence to lowest:

  1. Command line parameter
  2. Environment variable
  3. Saved Current Work Environment value

This means that a value provided explicitly on the command line will override the environment variable and saved configuration file values. Likewise the environment variable value will override anything set in the configuration file. Use the rtcwi.py list cwe to see details about what values are currently being used by the command.

Variable name

Description

RTCWI_CWEFILE

Name of the configuration file. This is located in the configuration directory.

RTCWI_REPOSITORY

Name of the repository to connect to. This can be used in place of the -r | --repository command line parameter.

RTCWI_PROJECT

Name of the project to operate on. This can be used in place of the -p | --project command line parameter.

RTCWI_USER

User ID to sign in with. This can be used in place of the -u | --user command line parameter.

RTCWI_VERBOSITY

Verbosity level for command output. This can be used in place of the -V | --verbosity command line parameter.

RTCWI_TRANSLATE

Attribute translation mode. This can be used in place of the -x | --translate command line parameter.

Special Data Formats

Here are some considerations for some special types of data used on the rtcwicli command:

  • Date Format - To input date values the date must be specified in one of the following formats:
    • "yyyy-mm-ddTHH:MM:SS.000Z" Example: "2013-06-17T20:29:50.581Z"
      • The date/time is in UTC time zone.
      • This is the format that RTC uses natively.
    • "yyyy-mm-dd" Example: "2013-06-17" June 17th, 2013, midnight in the time zone on the system where the command is being run.
    • "yyyy/mm/dd" Example: "2013/06/17" June 17th, 2013, midnight in the time zone on the system where the command is being run.
    • "yyyy-mm-ddTHH:MM" Example: "2013-06-17T13:35" June 17th, 2013 at 1:35 PM in the time zone on the system where the command is being run.
    • "yyyy/mm/ddTHH:MM" Example: "2013/06/17T13:35" June 17th, 2013 at 1:35PM in the time zone on the system where the command is being run.
    • Any of the above 4 formats with the letter Z at the end specifies that the date/time specified is in the UTC time zone.
  • Users - RTC Web displays Human readable names, however when referring to a user in rtcwi.py, user the User ID value must be specified (generally the internet email format (ie fred@xyz.com ))
  • URLs - any urls referenced should be correctly URL encoded (for example replace @ with %40)
  • Tags - the Tags attribute can be specified as follows, either "Tags" : "OneTag" or "Tags" : "one, two, three" for multiple tags There is currently no way to append additional tags or remove individual tags.
  • Lists - lists such as the subscriber's list can refer to multiple entries as follows: subscribe 321 user1@xyz.com user2@xyz.com user3@xyz.com

Installation and System Requiremetns

The tool is implemented in Python and to run the the command a Python interpreter will need to be installed on the system.

Python requirements:

  • Python 2.6 or 2.7 (has not been tested on Python 3.x)
  • A Python Package Manager like "pip" to help

Tested on:

These are the platforms that RTCWI has been tested on. Other platforms and Python versions may be supported but extensive testing has only been done in these environments:

  • Linux: Python 2.7
  • Windows: Python 2.6, 2.7
  • AIX: Python 2.7

Installation Preparation:

  • Install a supported Python version for your platform.
  • It is recommended that you install a Python Package Manager like PIP if your platform supports it. See the PIP install instructions below for more information.

PIP Install Instructions: Quick Start

Here are the basic instructions for installing PIP. On Linux or AIX these may require root or sudo access to make changes to the Python installation.

  1. Download the ez_setup.py script to your system: https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
  2. From a command prompt run the ez_setup.py Python script:   python ez_setup.py
  3. Download the get-pip.py script to your system: https://raw.github.com/pypa/pip/master/contrib/get-pip.py
  4. From a command prompt run the get-pip.py script:   python get-pip.py

For more detailed installation instructions for PIP see the PIP install instructions here: http://www.pip-installer.org/en/latest/installing.html

Installing RTCWI:

Choose one of the following methods to install RTCWI.

Option 1: Install using PIP

pip install rtcwi -f [URL]

Option 2: Other Python Package Manager:

If you have already installed a Package Manager other than PIP for your Python installation you can use that to install the RTCWI package. Refer to your package manager documentation for instructions. The RTCWI package is available here: rtcwi-13.3.zip 

Option 3: Manually install RTCWI and dependencies if you cannot install a Python Package Manager:

  1. Download the current RTCWI package from here: rtcwi-13.3.zip
  2. Download the 1.2 version of Requests from here: https://pypi.python.org/packages/source/r/requests/requests-1.2.0.tar.gz 
  3. Install requests:
    1. Uncompress the requests package
    2. Change to the requests-1.2.0 directory
    3. Run command: python setup.py install
  4. Install RTCWI:
    1. Uncompress the rtcwi package
    2. Change to the rtcwi-13.3 directory
    3. Run command: python setup.py install

Note about path: The rtcwi package installs the startup script rtcwi.py in the Python Scripts directory. If this directory is not on your path you won't be able to start up rtcwi.py without specifying the full path to the location of the script.