Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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.

Regards,

Kristian

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.

Manoj

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.

Regards,

Kristian

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. :)

Thanks,

Manoj

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.

Regards,

Kristian

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase

All you wanted to know about customer support KPIs

When working in customer support, it’s crucial to calculate, analyze and monitor specific numbers, called KPIs (Key Performance Indicators). They go hand-in-hand with customer satisfaction, problem d...

133 views 1 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you