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?
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
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.