Forums

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

Copying values from a custom field to Request Participant ?

Touqeer Anjum
Contributor
December 20, 2023

Hi,

I'm trying to capture values from a custom field in the ticket and once ticket is created add those values to the Request Participant field.

For testing purpose I'm using a registered user and an unregistered user.

Found this link How to add/update/remove Request Participants using Automation for Jira | Jira | Atlassian Documentation

And I' using the below code 

{"update": {
  "Request participants": [
   {{#issue.Approvers}}{"add": {"id":"{{accountId}}"}}{{^last}},{{/}}{{/}} 
  ]
 } 
}

But am seeing the below error.

Additional fields contains invalid 'update'. You can use 'add', 'remove', 'set' or 'edit' for operations. customfield_10026

customfield_10026 is of Request Participant.

Any thoughts on what to do ?

Thank You

1 answer

0 votes
Jack Brickey
Community Champion
December 20, 2023

Hi @Touqeer Anjum , it appears that you are using the exact code block from the linked article. In that article I believe they are copying from the approvers field. I would assume that you are not using that field but you have your own custom field? If that is the case, then you should replace the approvers with your custom field I believe.

Touqeer Anjum
Contributor
December 20, 2023

Thanks @Jack Brickey 

I changed that to customfield, and now am seeing a different error.

CODE:

{"update": {
"Request participants": [
{{#issue.customfield_10083}}{"add": {"id":"{{accountId}}"}}{{^last}},{{/}}{{/}}
]
}
}

ERROR :

(Field 'customfield_10026' cannot appear in both 'fields' and 'update')

I'm not sure what this error means.

Jack Brickey
Community Champion
December 20, 2023

Please share a screenshot of your automation rule. I will try to try and recreate/test today if I can.

Touqeer Anjum
Contributor
December 20, 2023

Thanks..

In the image CC is the customfield.

1.png2.png3.png

Touqeer Anjum
Contributor
December 20, 2023

I changed the code (as in image 3) to test it differently, still the same error..

Jack Brickey
Community Champion
December 20, 2023

Can you uncheck Request Participants in your Edit issue component and simply use the JSON.

Touqeer Anjum
Contributor
December 20, 2023

Thanks,

Unchecked and now the error is

Error while parsing additional fields. Not valid JSON.

Touqeer Anjum
Contributor
December 21, 2023

Hi,

I changed it to Request Participant, and set it to use Smart Value which is 

{{issue.customfield_10083}}

The issue with this is only works with if there is 1 value in the custom field, with multiple values it fails with the below error, even though both users are registered.

Inactive user

email1@yahoo.com, email2@gmail.com

I tested them and they both get individually without any issues.

Suggest an answer

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

Atlassian Community Events