Hi All,
I am trying to use the Jira automation to edit a multi user picker field. We use Jira Service management and what I would like to do when an issue is updated by a certain member, then a specific user is removed from the Approvers field. I've tried different variations of JSON code but I can't get anything to work. I'Ve looked through the commmunity posts of this and although there seems to be some solutions none are working for me.
Solved: Jira Automation - Edit issue multi user picker fie... (atlassian.com)
Remove "Request Participants" using Automation rul... (atlassian.com)
If anyone could help me it would be much appreciated.
thanks in advance.
Alex.
@alexander_cartlidge , this is working for me
{
"update": {
"approvers" : [
{
"remove": {
"id":"user_id"
}
}
]
}
}
Can you try this in your automation rule and share the screenshot of your audit log automation? If you could share your complete automation rule, I think can help us to understand better your rule structure.
Let me know if you have questions
Hi Fernando,
Thanks for the quick reply. Unfortunately no it doesn't work for me. However if I substitute the "user_id" for "name" and use a custom field smart value I can get it to work. The customfield is populated with a post function upon issue creation and then I can use that.
{
"update": {
"Approvers": [
{
"remove": { "name": "{{Delegate Approver.name}}" }
}
]
}
}
}
So this will solve half the problem. Thanks for pointing me in the right direction. What the rule should do is remove 1 of the 2 approving Managers when the 1 Manager approves the request / Issue.
The problem I have now is the fact that an approval does not trigger an update to the issue. So although I have a working rule I have no trigger to make the rule run. If you have an idea about that one. I'm all ears :)
Kind regards
Alex.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Glad to know that it worked for you!
If you don't have the "Approval Completed" trigger on your automation, then you can use the "Issue Transitioned" event to execute your rule.
Considering that when Manager 1 approves, jira will transition the Issue to another status, I believe this trigger will help you with that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Fernando Eugênio da Silva ,
I have multiple users in the Approvers field and want to remove the one who triggered it.
Even tho I used the initiator.accountId still it's removing the other users as well.
Any assistance will be appreciated.
Thank you in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you tried this?
{
"update": {
"approvers" : [
{
"remove": {
"id":"{{initiator}}"
}
}
]
}
}
Works fine for me.
Hope this helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Fernando Eugênio da Silva i have tried this with my automation but it is giving me error in Audit log
(Specify a valid value for customfield_XXX (customfield_XXX))
{
"update": {
"Approval1" : [
{
"remove": {
"id":"{{Approved2}}"
}
}
]
}
}
Could you please help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you share your audit log error?
Also, the value 'approved2' is a customfield Picker User or is the user initiator of one second step approval?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was able to get this using below code
{
"update": {
"app2": [
{{#issue.aap1}}{"remove": {"id":"{{accountId}}"}}{{^last}},{{/}}{{/}}
]
}
}
Now iam struggling with is if i remove value from app1 it should get added back to app2 tried to use same code with add instead of remove but it adds the value which is in app1,
Any idea how can i get this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I am also facing the same issue, that I cannot either add or remove a user from multi user custom field.
I am using
Remove:
{
"update": {
"customfield_12345": [{
"remove": {"id":"{{1585625}}"}
}]
}
}
Add:
{
"update": {
"customfield_12345": [{
"add": {"id":"{{1585625}}"}
}]
}
}
Is there something wrong in above, am I missing soemthing?
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Harsh i used -
to remove -
{
"update": {
"Pending Approval": [
{{#issue.Already Approved}}{"remove": {"id":"{{accountId}}"}}{{^last}},{{/}}{{/}}
]
}
}
To Add -
{
"update": {
"Pending Approval": [
{{#issue.Already Approved}}{"add": {"id":"{{deletedFieldChange.values}}"}}{{^last}},{{/}}{{/}}
]
}
}
it works for me
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the response
If I understand correctly
- Pending Approval is the field you are changing and I assume we can use as - customfield_123
-{{#issue.Already Approved}} what is this?
So to give a background - what I am trying to achieve is when the value changes for a field I want my user field (multi user) to be updated and remove with users accordingly .
If you have any idea how to achieve this that would be great.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Harsh I had 3 fields
1) Approver
2) pending Approver
3) Already Approved
firstly all the users were added in approver same names would get added in Pending Approver (automation to add)
Then as and when users would add there name in already approved the names would get removed from pending approver
Hope that answers your question
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the update.
Do you have idea how I can achieve the below
So to give a background - what I am trying to achieve is when the issue is created or updated.
Example-
If component= A(on creation or edit action)
Then multi user field should be updated to user A and user B
If at any point of time component A is removed then remove the above user.
Is this achievable. ?
I tried your json and edited but no luck.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi folks,
I have a customfield "Approved" and we have a list of approvers for a CAB. The workflow status has the configure "2 approval(s)" needed.
When the 2 approvers has approved done we want to remove the other approvers from the approval list.
If anyone could have a good idea it would be much appreciated.
Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.