How to, using automation, add and remove a request participant via email address

Remy
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 7, 2024

Basically I have an issue type that adds and removes request participants based on changes to an object field. In the object field the user's name and email is stored but not their customer accountID.

What I want to do is when the object field changes, remove the specific old RP and add a new one. I know how to do it with the account ID, but I am having trouble doing it when using just the email. At the moment I tried this in the "advanced" edit issue but it doesn't seem to work: 

{"update": {
"Request participants": [
{
"add": {"email":"{{issue."assigned contractor".email}}"}
},
{
"remove": {"email":"{{lookupObjects.email}}"}
}
]
}
}

 The lookupObjects looks up an asset in my db that contains name and email from the {{fieldchange.fromstring}}

 

Using the auditlog it seems like {{lookupObjects,email}} is returning empty...

1 answer

1 vote
Bill Sheboy
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.
April 8, 2024

Hi @Remy -- Welcome to the Atlassian Community!

First thing, I am not using JSM and my suggestions are based on what I know about automation rules...

To add / remove users with JSON for Jira Cloud, the id value is needed, as described here:

Please check if the accountId attribute is available in the lookup object.  If it is, try using that.

Kind regards,
Bill

Suggest an answer

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

Atlassian Community Events