Link to home
Start Free TrialLog in
Avatar of beer9
beer9Flag for India

asked on

Using JIRA module how to move a issue as subtask in Python

I am using below code:

from jira import JIRA
import sys

options = {'server': 'https://jira.com', 'verify': False}
jira = JIRA(options, basic_auth=('user@example.com', 'Password123'))

child_key = sys.argv[1]
parent_key = sys.argv[2]

issue = jira.issue(child_key)
update_issue = issue.update(issuetype={'name': 'Sub Task'}, parent={'key': parent_key})

Open in new window


But when I run it as
python mycode.py PROJECT-123 PROJECT-100

Open in new window

then I get the below error:
Issue type is a sub-task but parent issue key or id not specified.

Open in new window


Though I am providing the parent key, I would like to know how to fix it?
ASKER CERTIFIED SOLUTION
Avatar of Phil Davidson
Phil Davidson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of beer9

ASKER

parent_key is a variable I have to keep it without quotes