HELP!!! Using Python Jira API, how to create a task under a given user story?

Clicker April 27, 2022

Here is my use case.

I have to create multiple tasks under a single user story (SMGP-1000) on the 3rd of every month. These tasks are tracked for various purposes. Now, I am able to create multiple tasks using the below code.

new_task=jira_instance(project='2323', summary='New Task',description='',issuetype={'name'='Task'})

Then what I am trying is, to use this function from Jira add_remote_link() function to link this task with SMGP-1000. At this point, I get a failure ( Get Recoverable Error from GET https://jira......, will retry [1/3] in 10s " 

add_remote_link(SMGP-1000,new_task )  # I tried swapping the variables, but still same error.

 

Could you please help me with a code snippet on how to link this new task to that given story?

1 answer

1 accepted

0 votes
Answer accepted
Thiago Masutti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 29, 2022

Hi @Clicker 

I believe you need to use create_issue_link 

It would be something link this

inwardIssue = jira.issue("storyissue-1")
outwardIssue = jira.issue("taskissue-1")
issueLinkType = 'Relates'
jira.create_issue_link(issueLinkType,inwardIssue,outwardIssue)


I hope that helps.

Kind regards,
Thiago Masutti

Suggest an answer

Log in or Sign up to answer