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

Your Points Tracker
  • 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
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?
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

JIRA cloud scriptrunner workflow post function: set user picker value for custom field

I have a custom field that is type user picker, and I am trying to update the user associated with this field on issue creation. However, I have not been able to assign the user picker field. 

In the below example, my logged output shows that "updated user: 'jdoe'" but this change is not reflected on the JIRA ticket.

def username = "jdoe"

issueInput.fields.customfield_16400 = [name: username]"updated user: " + issueInput.fields.customfield_16400)

What type does the custom field for user picker expect, and how do I go about updating it?

Please note that I use JIRA Cloud.

2 answers

1 accepted

1 vote
Answer accepted

Hi Samuel,

Thank you for your question.

I can confirm that it is no longer possible to set a user field using a users name since Atlassian recently updated their API's to make changes to comply with the GDPR legalisation as described here.

These changes means that all user references for API's have been updated to use an accountID rather than by using a name or key.

This legislation means that Atlassian has had to update all of its rest API's in order to comply with this which mandates how data is stored.

I can confirm that we have created a page in our documentation site located here which shows how you should update your scripts to be GDPR compliant and we would advise that you review this page in order to see further details of how to set a user using an accountID and can confirm that the section located here shows how to set a user field on an issue using a users account ID.

If this answer has solved your issue can you please accept it in order to mark this answer as correct for users who are searching for a similar issue.



User accounid as the value when using Update Issue Custom Field.

How to get accountid:

https://[domain name][user email]

In the return string, which looks like this, you can spot the accountid:

[{"self":"https://[domain name]","key":"admin","accountId":"557058:1991c146-4646-43d3-98d0-xxx","accountType":"atlassian","name":"admin","emailAddress":"[user email]","avatarUrls":{"48x48":"","24x24":"","16x16":"","32x32":""},"displayName":"user full name","active":true,"timeZone":"Europe/Berlin","locale":"en_US"}]

Hi, could you advise the code about how to get accountId from the return string in Scriprunner?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Marketplace Apps & Integrations

New Cloud Apps Roundup - April 2021

Atlassian's marketplace partners have had a very productive start to 2021! Since our last roundup, our developer community has added over 160 new cloud apps to the Atlassian Marketplace to help you...

289 views 3 20
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