Set user single select custom field from automation or JiraPS

Fabien Thoumsin
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!
February 22, 2024

Hi,

I am trying to set a single user select custom field either via the JiraPS module or Jira Automation from the email of a user. 

1. Via the JiraPS module:

I am using the following snippet:

$fields = @{
"customfield_yyyy" = "email@dn.com"
}

Set-JiraIssue -Fields $fields -Issue "xxxx" -Credential $Cred

I have tried several things, like "customfield_yyyy" = {name: "Firstname Lastname"} and things but that just set the field to none. 

 

2. Via Jira Automation, it the same, I am trying to find the way to set the select with a hardcoded value but it always reset it to none. I using the following snippet in the advance issue edit action:

{
"fields": {
"customfield_yyyy" : { "value":account_id }
}
}

I tried several things instead of the account_id, but the behavior is the same. 

 

I would like to apply approval based on this field so I do need a user select field. 

Any idea? 

 

Thanks! 

1 answer

0 votes
Walter Buggenhout
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 22, 2024

Hi @Fabien Thoumsin and welcome to the Community!

I am not familiar with the JiraPS module you are referring to. But I would expect you should be able to do this with automation, most likely not even through the advanced fields option you are trying to use.

With the edit issue action I would expect you to be able to just select the field you are trying to fill out. And if this is indeed always the same value, you might be able to just select the desired user from the list, as you can see here for assignee:

Screenshot 2024-02-22 at 16.16.41.png

Hope this helps!

Fabien Thoumsin
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!
February 22, 2024

Hi Walter,

Thanks for your reply, but this is not always the same value. I am using an external script to determine the manager of the requestor. 

The script is in PowerShell and leverage the JiraPS module. As I was not able to set the single user select field form the script, I wanted to try with the automation.

In the automation, I would like to set the single user select field from an email address. 

I tried first to set the field with a hard coded value but I could not succeed. The Json I used in the automation must be wrong, but reading the doc, I can't spot my mistake. 

Long story short, this is not always the same value. 

Thanks!

Bill Sheboy
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.
February 22, 2024

Hi @Fabien Thoumsin -- Welcome to the Atlassian Community!

Adding to Walter's answer...

Your syntax using the JSON edit for a user-picker field is incorrect.  Here is the syntax: https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Single-user-picker-custom-field

And, you will not be able to select the user with their email address in this way; the account id is needed. 

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events