Dear community!
I have an approver field in a Service Management project managed by a team (decided to test the updates on a real project).
But the approval process is simplified in this type of project, it is impossible to remove a separate field of approvers from the business process, users can change at any time, and then send to them for approval, knowing the entire list of users in advance.
I added the following JSON to the field when creating the request:
{
"update": {
"customfield_10120" : [
{"add": {"accountId":"XXX"}},
{"add": {"accountId":"CCC"}}
],
"customfield_10121" : [
{"add": {"accountId":"XXX"}},
{"add": {"accountId":"CCC"}}
]
}
}
Accordingly, I have two fields - one is editable - 10121, the second is not.
How can I copy values from 10121 to 10120 field when changes (adding or removing users)?
I tried everything, but usually I got an error data was not an array (customfield_10120))
{
"update": {
"customfield_10120": [
{
"set": "customfield_10120"
}
]
}
}
{
"fields": {
"customfield_10120": "{{issue.fields.customfield_10121}}"
}
}
{
"update": {
"customfield_10120": [{
"add": {"id":"{{customfield_10121.accountId}}"}
}]
}
}
Thanks in advance!
In order to copy users from one user picker field field to another you have to do it one user at the time. So in your automation add an Advanced branching and set the smart value to the first field, and then edit the second field using this JSON:
{
"update": {
"customfield_10120": [{
"add": {
"id":"{{smartValue}}"
}
}]
}
}
Just replace the smartValue with the name that you gave it.
Thanks for your answer!
What am I doing wrong? I see a error Specify a Valid value for «customfield_10120» (customfield_10120))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is customfield_10121 a single user picker field or multi-user? If it is a user picker field then you do not have to add .accountId when you set the smart value, that field will store the accountId already, but what you see is the display name.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.