JIRA Command Line Interface; how to link subtask and issue?

Pangianto Pang September 30, 2012

Hi All,

I am using JIRA 4.2.3 where importing subtask and link to parent issue is not available,

so i imported the subtasks and parent issues, and want to you CLI to link them.

I have the subtasks issue key and parent issue key, but i do not know how to link them.

Can kindly advice me on this problem?

3 answers

0 votes
Pangianto Pang October 1, 2012

It appears as the subtasks.

The subtasks can be sucessfully imported without parent in the JIRA 4.2.3, so the next step is to link the subtask to the parent issue (ideally with issue id), however i do not know how to link them using CLI?

Or any work around?

0 votes
Norman Abramovitz
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 30, 2012

After you imported the data do your subtasks mentioned above show up as subtasks or as issues?

0 votes
Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 30, 2012

Are you asking how to convert an issue (not a subtast) into a subtask of another issue like Convert to Subtask on the UI? If so, this is not possible via the CLI or available remote APIs.

Pangianto Pang October 1, 2012

The subtasks without parent as well as the issue items are sucessfully imported in the JIRA 4.2.3 (because the feature of indicating parent id and issue id is not available), so the next step is to link the subtask to the parent issue (ideally with issue id), however i do not know how to link them using CLI?

Or any work around?

Pangianto Pang October 1, 2012

or how do i use the "createIssue" cmd line, when i want to set 'due date', 'date created', 'status' and other custom field? because i do not see the duedate and the rest in the parameters.

i can use this command line to create the sub tasks associate with issue items if i can set those above. Thanks.

createIssue

Issues

Create a new issue or subtask for a project.

project, type,summary

parent, priority, reporter, assignee,description, components, affectsVersions,fixVersions, environment, security, field,values, field2, values2, asVersion,asComponent, asCascadeSelect, date,dateFormat, custom, autoVersion, autoComponent, comment, group, role,findReplace, findReplaceRegex, file,encoding

Pangianto Pang October 1, 2012

and may i know how to more than 2 fields (field, field2) in one command line?

Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 1, 2012

Examples can often be used to help with this type of question. Specifically to your questions

  1. date is the due date for update issue
  2. the remote API does not allow the setting of the create date - it will be the date the issue is created :(. This is an old complaint against JIRA in general
  3. An arbitrary number of custom fields can be set with custom parameter. The field/value and field2/value2 parameters are conveniences and easier to use.
Pangianto Pang October 9, 2012

Hi may i know how to insert date into custom field that is in date format? i keep on getting java null pointer exception. below is the command:

bash-3.00$ ./jira.sh --action updateIssue --issue "EQAPSTAB-1090" --custom "'GERR Sub-Task Due Date:01/01/2012'"
Remote error: java.lang.NullPointerException
If i left only the ./jira.sh --action updateIssue --issue "EQAPSTAB-1090" then i will throw a appropiate error saying no field is updated.
so i suspect the date format is wrong.
Please kindly help me get over this problem, if not i have to update a lot of record manually.
Thanks
Pangianto Pang October 9, 2012

An example would be appreciated.

Thanks in advanced.

Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 9, 2012
Pangianto Pang October 10, 2012

It works fine after a JIRA restart

bash-3.00$ ./jira.sh --action updateIssue --issue "EQAPSTAB-1090" --custom "'GERR Sub-Task Due Date:01/Jan/12'"

Thx bob, you are a life saver.

Suggest an answer

Log in or Sign up to answer