Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Assign scriptrunner subtask to assignee of parent task

Matthew Hauer November 13, 2018

I am using scriptrunner cloud. How can I create a subtask on a postfunction and assign the assignee of the parent issue to that subtask?

1 answer

0 votes
Kristian Walker _Adaptavist_
Community Champion
November 19, 2018

Hi Mathew,

Thank you for your question.

I can confirm that ScriptRunner for Jira Cloud comes with a built in post function called *Create Subtask* which you can use to createa subtask when an issue is transitioned and you can see more detailed information on this inside of the documentation page located here.

In order to set the assignee when you create the subtask you can take the code located here and paste it into the *Additional Code* box on screen.

If this response has answered your question can you please mark it as accepted so that other users can see it is correct when searching for similar answers.

Regards,
Kristian

Matthew Hauer November 20, 2018

Thanks - but this isn't quite working.

 

For example, if I assign myself (Matthew Hauer, username hauerm) to the parent issue, transition the issue, and trigger the post-function, it doesn't work. When checking the logs it says "user matthew.hauer doesn't exist". But my username isn't matthew.hauer, it's hauerm.

 

Any idea on how to fix that?

Kristian Walker _Adaptavist_
Community Champion
November 22, 2018

Hi Matthew,

I updated the script I shared previously to get the assignee by name rather than key.

Can you please try the new script which you can find at the link I shared previously and let me know if this resolves your issue.

Regards,

Kristian

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events