Search code examples
pythonjirapython-jira

How can I move a subtask from one parent issue to another using jira-python


I am trying to move a Jira subtask to a new parent. I have tried the following, but the task is not moved and no error is raised.

from jira.client import JIRA
jira_client = JIRA(options={....}, ouath={...})
query = "...some JSQL query...."
issues = jira_client.search_issues(query)
issue = issues[0]
current_parent_id = str(issue.fields.parent)
if current_parent_id = 'IU-999':
    issue.update(parent =  {'id': 'IU-1000'})

I am using jira-python 3.0.1.


Solution

  • https://community.atlassian.com/t5/Jira-questions/Can-I-change-the-parent-field-of-sub-task-in-Jira-via-REST-API/qaq-p/750954 shows how to do it with ScriptRunner but I don't know if this can be done using the JIRA REST API, Data Center or Cloud. If it's not in REST, then Jira-Python cannot do it

    You could copy the issue but that's ugly