Hi,
I created a Jira Automation that aims to notify several people when a ticket is moved.
I created a custom field named "Relecteur(s)" of type "User list". Any user from this list can move the ticket. When the ticket is moved, it sends a mail to the assignee.
Inside my mail, I write that {{initiator.displayName}} has moved the ticket. But I want to display the names of the others "Relecteur(s)". I tried a lot of stuff to remove {{initiator.displayName}} from this list without succeeding...
I could remove the initator from the string, but the format is not great.
{{issue.Relecteur(s).displayName.remove(initiator.displayName)}}
For example, if Relecteur(s) is equal to [Alex], [John] and [Maria], and [Alex] is the initiator, I got ", John, Maria".
I tried to parse the list, and to condition the display. It seems that while parsing a list, other variables are not reachable...
{{#issue.Relecteur(s)}}
{{if(not(equals(displayName, initiator.displayName)), displayName)}}
{{/}}
With the example list above, I got "AlexJohnMaria"
What I really want is to have a list of two entries with [John] and [Maria].
Anyone has an idea ? I couldn't find an easy regex to solve my problem. I think that something inside Jira Automation List can help me, but couldn't find any solution.
Regards,
Alexis
Hi @Alexis LAFONT -- Welcome to the Atlassian Community!
As you have found, once inside of a list iterator no other higher scoped fields/variables are visible.
There are several possible work-arounds for your scenario. One is to expand all of the displayNames into a created variable first (with delimiters), then use the remove() function on the result, and finally use split to create a list for processing again.
Kind regards,
Bill
Hi,
I tried something like this but is is hard to correctly remove the initiator using split. Using a delimiter can always result in "NameA, , NameB" instead of "NameA, NameB", and it changes if the name to remove is first, last or in the middle.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, and the text functions replace() and replaceAll() can help with that...For example, you can chain functions to remove anything extra or which does not match your needs.
This could also be a problem with the iterator, so if you post that the community can offer suggestions. For example, to avoid the trailing comma in can help to use the {{^last}} expression:
{{#someObjectToIterateOver}}{fieldWanted}}{{^last}}, {{/}}{{/}}
This would create a comma-separated values list, and leave off any trailing comma.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Inside the custom field list you cannot access any other values(for example assignee or another custom field value). So that's the reason you could not filter the names
Can you explain a bit more about how many people you want to send email so that we can find alternate approach in automation
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gokaraju gopi,
Ok that is why !
I've got multiple Relecteur(s), only one initiator. So my list size is [1;n] and should be [1;n-1] afterwards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gokaraju gopi,
Was out of the office for a few weeks, so I'm bumping this thread again !
Do you know if there is a workaround to access other values ? Like passing values into temp variable and manipulate them after, or something like this ?
Thanks
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.