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

Problems setting a custom field with json automation

Ton Rigat October 11, 2023

Hello,

I have started to learn automations for Jira a couple of months ago, but I've stumbled with a problem.

We have an approver field, with the configuration of making the assigned user to set it, but we want to set it with an automation.

With this code, it seems that works fine:

{
"fields": {
"customfield_10112": "{{issue.reporter.asJsonString}}"
}
}

image.png

But it does not, it doesn't return an error but also does not update the field:

image.pngimage.png

I have also tried to use the user ID, but the field won't accept it with this format.

TIA.

Ton

 

1 answer

0 votes
Marc - Devoteam
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.
October 11, 2023

Hi @Ton Rigat 

Welcome to the community.

I expect you want the issue reporter to be the approver.

You don't need to use the advanced option, you can use the smart value {{issue.Reporter}}:

Capture d’écran 2020-10-23 à 11.52.51.png

Will this help solve your issue?

Ton Rigat October 11, 2023

Thanks for the fast answer.

It's not exactly right, it works but not with the same field:

image.png

image.png

The problem is that the field "Reviewer" does not appear in the list of fields, that is why I was trying to do it with JSON

Marc - Devoteam
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.
October 11, 2023

Hi @Ton Rigat 

I expect that the custom field Reviewer is also of the type single or multi user.

Try to set the Reviewer as follows

{
"fields": {
"customfield_10112": { 'id": "{{reporter.accountId}}"}
}
}

Ton Rigat October 11, 2023

Still something wrong:

image.pngI used both variants: issue.reporter.accountID and reporter.accountID

Both return the same error. 

Marc - Devoteam
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.
October 11, 2023

HI @Ton Rigat 

What is the field type of the custom field "Reviewer"?

Ton Rigat October 11, 2023

It's autogenerated by Jira, I guess it's user type.

image.png

Suggest an answer

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

Atlassian Community Events