I would like to clone an issue and it's subtasks via python automation. In order to do this, I read in the story data and create a new story. Next, I read the subtasks and create new subtasks and then add them to the new story. Each subtask has a description of the task to be completed.
When pulling the data for a subtask, there is no description, labels, components or other fields.
When you pull the fields for a subtask, this is all I get. Removed some info and replaced with ***
subtask = jira.issue(subtask_key)
json_fields = subtask.raw['fields']
print(json.dumps(json_fields, indent=3))
"fields": {
"summary": "Test Summary",
"status": {
"self": "***",
"description": "New issue that needs to be triaged.",
"iconUrl": "***",
"name": "Screen",
"id": "1",
"statusCategory": {
"self": "***",
"id": 2,
"key": "new",
"colorName": "blue-gray",
"name": "To Do"
},
"priority": {
"self": "*",
"iconUrl": "*",
"name": "Major",
"id": "3"
},
"issuetype": {
"self": "*",
"id": "5",
"description": "The sub-task of the issue",
"iconUrl": "*",
"name": "Sub-Task",
"subtask": true,
"avatarId": 18416
}
}