Forums

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

Add Approvers to custom field using JSON

Deleted user February 28, 2023

When the approvers field is updated, I am trying to automatically add those users to the existing custom field (as it may already contain some users and I want to preserve them, and just add on them)

Be aware, both fields are multi-user fields.


I've tried this and gotten the following error,
Field 'customfield_10561' cannot appear in both 'fields' and 'update')

{
"update": {
"customfield_10561" : [
{
"add": {
"issue.approvers" : [
]}
}
]
}
}

 

1 answer

1 accepted

1 vote
Answer accepted
Tobias H
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.
March 2, 2023

Hi Timothy!

Could you perhaps show the full automation, and clarify whether CF_10561 is a different field than Approvers. (Because based on the error message you are trying to update the Approvers field with information from the Approvers field, but using the CF id)

Perhaps you could accomplish what you are after without using Json?

  • When: Value change for
    • Fields to monitor change: [Custom Field Name]
    • Change type: Value added
  • Then: Edit issue fields
    • From the Cogwheel dropdown select Approvers
    • Press the three dots on the right and set Copy
    • Press the Add X from Current issue text
      • Change Field to copy value from to Custom Field
      • Make sure the checkbox for Add to existing values is checked.
    • Save

Hopefully this works better for you 🤞

Deleted user March 5, 2023

Thank you Tobias, 

That worked great! Thank you :)

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