Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

ScriptRunner Cloud - Select Assignee for Subtask

I'm using ScriptRunner for Jira Cloud.

I set up a post-function to create a subtask upon transition. I would like to be able to choose the assignee from a list of current Jira users at the time the subtask is created (a drop-down list of all Jira users would suffice). I haven't been able to find anything like this in my searches. Can someone out there point me in the right direction or let me know whether this is not possible?

Separately, I've tried using the provided 'Must have Assignee' code, but that doesn't seem to do anything.

issue.fields.assignee != null

Thank you.

1 answer

1 accepted

0 votes
Answer accepted

Hi Manoj.abraham, 

I can confirm that it is not possible to pop up a dialogue form which can be used to select the assignee when creating a subtask with ScriptRunner for Jira Cloud.

The reason for this is due to the fact that Atlassian does not provide the same Java API in Jira Cloud that they do in Jira Server and that Jira Cloud only contains a rest API.

Unfortunately, the Rest API provided by Jira Cloud does not provide us with the API's that would be required to create dialogues or the functionality to dynamically populate fields based on values selected in other fields like you can do with the Behaviours feature on Jira Server.

You can see more detailed information on the differences between ScriptRunner for JIRA Cloud and ScriptRunner for JIRA Server inside of the documentation page located here.



Thank you, Kristian. I appreciate your detailed answer.

Is it possible for me to set the assignee based on the value in a custom field then? I've been searching for this is as well, but all solutions seem to refer to Jira APIs.

Thanks again.


Hi Manoj,

I can confirm to set the assignee that you would need to write some code to extract the value from the user field and to save this to a variable in your script.

Your script would then need to make a put request to the issue API to update the issue and to the assignee to the value, you saved in your variable.

I can confirm that we have an example script located here which shows how to set the assignee to the value of a user picker field and you will be able to use this as a reference guide to help create the script that you require to achive your requirement.



Thanks again, Kristian.

When trying the code snippet, I get the following error on line 31:

[Static type checking] - No such property: null for class: sr.json.issue.issuelinks$3$3 @ line 31, column 21.

I'm not sure if this is an issue in my environment or with the code snippet itself.

If you can help, I'd appreciate. Else, that's fine - you've already given me a lot of information. :)



To clarify my last comment, I added the code snippet to the create subtask ScriptRunner post function.

Hi Manoj,

Thank you for your response.

I can confirm that if you are using the built-in Create Subtask post function provided by ScriptRunner for Jira Cloud that you can add some code in the Additional Code Box to set the assignee.

This code will get the accountId value off the user picker field on the parent issue and will set it as the assignee.

I can confirm that we have some sample code located here which shows how to do this and that you can use a reference.

In this sample code, you will just need to change customfield_1234  to be the ID for your user picker field.

I hope this helps.



Suggest an answer

Log in or Sign up to answer

Atlassian Community Events