Forums

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

Unable to set a custom user picker field with email address using automation for jira plugin

Arnel Burlayan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 22, 2019

I've been testing and searching for a way to set a custom user picker field with email address using automation for jira plugin via Edit Issue action > Additional fields window as follows without success:

1) 

{
"fields": {
"mycustom_user_picker": {"emailAddress": "{{blah@blah.com}}"}
}
}

 

2)

{
"update": {
"mycustom_user_picker": [{
"set": {"emailAddress": "{{blah@blah.com}}"}
}]
}
}

Both #1 and #2 above will give me success status after running the automation rule but "mycustom_user_picker" will still show empty.

However, if I paste blah@blah.com in "mycustom_user_picker" field in the Jira issue edit screen it will autocomplete and populate the fullname of Mr. Blah.

Any suggestions on how to set custom user picker field with email address using automation for jira plugin please?

 

1 answer

2 votes
Victor Seger
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 26, 2019

Hi @Arnel Burlayan ,

Automation for JIRA Support Team member here.

From what I've understood of your request, you're trying to fulfil a user picker with an email address, right?

I'd like to understand a little better about your scenario here:

  • Where does this e-mail comes from? Is it from a specific field? If it is, what is the field type?
  • If it is not from a field, why do you need to use the e-mail address? Is it not possible to use the username instead of the e-mail?
  • Can you please share with me some screenshots of your rule configuration?

Those details will help me doing a better job of helping you.

Thanks in advance!

Cheers,

Victor

Arnel Burlayan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 26, 2019

Hello @Victor Seger

Thank you for your response. I actually raised a case with code barrel support (CBS-16664) and has been advised that my use case is not supported at this stage and it is in their backlog (AUT-725 ) to fix this in the future. I'm hoping that it's in the very near future.

So, to answer your questions:

- Yes, that is correct, I am trying to populate a custom user picker field using an email address.

- To elaborate further so you'll have a idea of our use case...here's what I've written in the code barrel case:

========================

I am using the Advanced JSON Edit because my use case is different.

We are using email ingestion to populate the fields automatically by parsing both Summary and Description Fields of the ticket created.

So, my rule is basically

  • When issue is created -> parse the summary and description fields using the if/else block condition and regex -> edit ticket with "set" on all the fields involve.
  • Few different types of custom fields, ie. date and time pickers, radio buttons, select lists(both single and multi-select ), text and user picker fields
  • I only have a problem with setting up the user picker fields because our requirements changed where we don't have the user id or user name. We only have the email address.
  • I am aware that I can get the name, displayName and emailAddress attributes of the user picker fields but only when the user picker fields are set or populated (I've been using this solution on most of my rules)
  • Using the username to set the user pickers fields works perfectly fine but as I've mentioned above, our requirements have changed.

========================

I've been googling and found this: https://community.atlassian.com/t5/Marketplace-Apps-Integrations/Get-JIRA-username-from-email/qaq-p/597381

I know that Automation for Jira can run a Scriptrunner as an action.

But no success yet unfortunately.

Also, I was looking at hitting the API directly using the following search but it will take more time for me to craft a code that would parse the returned results where email address search would return a couple of users (e.g. email address associated to a couple of users). But a username/id is unique hence I guess most Jira and/or plugins support the lookup only by username/id and not email address.

http://localhost:8080/rest/api/2/user/search?username=blah@blah.com&includeActive=true&includeInactive=false

 Any suggestions how to get this to work please?


Best regards,
Arl B.

Victor Seger
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 27, 2019

Hi @Arnel Burlayan ,

I just saw the ticket that Yvan helped you with.

Currently, the best is to wait for the AUT ticket to be implemented. Although it might take some time to be ready, it will give you a most optimized solution to your scenario.

Let me know if you got any further questions.

Cheers,

Victor

Paul Benati
Contributor
March 16, 2021

FWIW, I too need this capability.  In my use case, I'm receiving a string from an external system (Salesforce) representing the email address of an employee.  I'd like to leverage that string and Automation for Jira to populate a People custom field in a JSM Next Gen project.

Thanks,
Paul

Suggest an answer

Log in or Sign up to answer