how to trigger notification mail depends on the custom field value changes during workflow transition

Hi ,

we have to trigger the mail based on the custom field value changes during the transition ..

is it possible ?

we are using customized workflow using JIRA workflow toolbox .

while changing the custom field value we have changed the team to allocate the issue .

for that we used set field as a function of other field values .

is it possible to trigger a mail based on this post functions ??

 

please suggest us ..

 

 

3 answers

1 accepted

Yes, it's possible. You can do it in 2 steps:

1) Use "Set a field as a function of other fields" post-function with a configuration like this:

conf-0.png

Setting rules in the example are:

a(DW)toString(usersInRole("Role A"))
a(Technology)toString(usersInGroup("Group A"))
a(Delivery)toString(usersInGroup("Group B"))
a(.*)toString(usersInRole("Role A") UNION usersInGroup("Group A") UNION usersInGroup("Group B"))

Where:

  • Role A is the name of a project role.
  • Group A and Group B are names of groups.

This post-function stores into virtual field Ephemeral string 1 a comma separated list of usernames.

Note that the last setting rule is a kind of else rule that will be executed only if none of the previous ones is matched. This setting rule also illustrates the way to obtain a list of users from more than one group or project role.

 

2) Use "Send an email" post-function with a configuration like this:

conf-1.png

 

Once configured, your transition should look like this:

conf-2.png

Is it possible to display the custom field value in the mail body content .

 

Yes, you simply have to insert field codes with format %{nnnnn}. Use the field code injector (select list) available below the Email's body text area. Field codes will be replace with their corresponding field values at execution time.

Hi Fidel ,

we have configured the mail and the mails are triggered based on the requirement .

In this we are facing the issue is triggering the mails to JIRA administrators also .

is it possible to send mail except the JIRA administrator group .

 

my conditions are :

a(DW)toString(usersInRole("DW Lead") UNION usersInRole("DW Developers") UNION usersInRole("Delivery Lead") UNION usersInRole("Delivery Developers"))

 

 

inside the roles we added the administrators for super admin access .

Can you please suggest us .

 

And also is it possible to add the user picker custom field  in this ??

 

Use the following setting rule:

a(DW)toString((usersInRole("DW Lead") UNION usersInRole("DW Developers") UNION usersInRole("Delivery Lead") UNION usersInRole("Delivery Developers")) EXCEPT usersInRole("Administrators"))

if you also want to add the user in a User Picker custom field, you simply have to select that field in parameter To - User in field in post-function "Send an email".

I am not sure Have u understood this in this way ..

Delivery Developer is a role :

in this role we have mapped the users , groups , and jira-administrator group .

is it possible to send the mail to users, groups in that role except the jira-administrators group 

Do you want to remove from To all the users which are in group jira-administrators and role Delivery Developer at the same time, or those users in group jira-administrators regardless of the roles they belong to?

i have to remove the JIRA - administrators group persons from the To mailing list .

 

Note : That group also mapped in the delivery developers role .

This is what we are having .

we have to send the mail to ramco_partner_support_leads and por_lead and not to jira-administrators .

 

Then use the following setting rule:

a(DW)toString((usersInRole("DW Lead") UNION usersInRole("DW Developers") UNION usersInRole("Delivery Lead") UNION usersInRole("Delivery Developers")) EXCEPT usersInGroup("jira-administrators"))

This one is also equivalent and has a more compact syntax:

a(DW)toString(usersInRole("DW Lead, DW Developers, Delivery Lead, Delivery Developers") EXCEPT usersInGroup("jira-administrators"))

is there any function to send a mail who is present in the user picker custom field .

if yes .. please let me know ..

usersInField is a valueable keyword or not .

 

 

if you want to also add the user in a User Picker custom field to the To list of your email, you simply have to select the custom field in parameter To - User in field in post-function "Send an email". Like in the screenshot:

To_send_email.png

Hi Fidel ,

 i need to send the mail to the person in the user picker in one conition only 

condition 1:

a(DW)toString((usersInRole("DW Lead") UNION usersInRole("DW Developers") UNION usersInRole("Delivery Lead") UNION usersInRole("Delivery Developers")) EXCEPT usersInGroup("jira-administrators"))

condition 2 :

a(Technology)toString((usersInRole("Delivery Lead") UNION usersInRole("Delivery Developers")) EXCEPT usersInGroup("jira-administrators"))

and (Support Person (Tech))

 

 i need to include the custom field user picker in the condition 2 only . not for all conditions 

Support Person (Tech) is the user picker custom field .


is it possible ??

 

Yes, use the following setting rule instead instead of your current second one:

a(Technology)toString((usersInRole("Delivery Lead") UNION usersInRole("Delivery Developers")) EXCEPT usersInGroup("jira-administrators")) + ", " + %{nnnnn}

replacing nnnnn with field code for custom field "Support Person (Tech)".

What we have done is to concatenate a new username to the comma separated list of usernames generated by the previous expression.

Yah Sure Fidel ,

Thanks for the immediate Support .

Its my personal request , can you share the tricks or possibilities for all post functions with the sample example .That will be helpful for all with the full fledged manual .

Thank you for your suggestion. I will improve the documentation adding more usage examples. There is certainly some work to do there.

Do you want to send an email only when a certain custom field has changed during transition execution?

we are having the custom field in the name of present team .

present team have the values :dw,tech,runtime

when i choose the dw the mail will trigger to certain group of people 

if i choose tech then mail wil trigger to some other group ..

is it possible ..

 

 

Hi Fidel,

I need some suggestion once again for this ..

is it possible to send the mail to two custom field values and one role persons and also i need to exclude a single user which is present in the role .

Taken this example :

Here i have to add assignee and also reporter and also another one user custom field values members and need to remove the below user group .

How can i do this ??

a(DW)toString(usersInGroup("SQ_DW_lead")) + ", "+ %{00003}

 

Scenario 2 :

Here i have to add assignee , reporter and also another one user custom field values members and need to remove the single user present under this project role or user group for mailer 

a(Partner)toString(usersInRole("Partner Lead") EXCEPT usersInGroup("jira-administrators")) + ", "+ %{00003}

 

Please help me to close this  .

@Fidel,

Hi @rTrack Support,

Scenario 1: Add assigneereporter and a user custom field and remove a user group.

 

a(DW)toString(usersInGroup("SQ_DW_lead") EXCEPT
usersInGroup("group_to_be_removed")) + ", "+ %{00003} +
", " + %{00006} + ", " + %{nnnnn}


where:

  • "group_to_be_removed" is the name of the group whose users you want to remove.
  • %{00003} is field code for Assignee
  • %{00006} is field code for Reporter
  • %{nnnnn} is field code of the user custom field you want to add.

Scenario 2: Add assignee , reporter and also another one user custom field and remove the single user

a(Partner)toString(usersInRole("Partner Lead") EXCEPT
toStringList("username_to_remove")) + ", "+ %{00003} +
", " + %{00006}

where "username_to_remove" is the user name of the user you want to remove.

How to add only the user fields in the above scenarios without project roles and user groups 

a(Partner) toString(%{00003} + ", "+ %{00006}) 

Is this correct???. 

More simple:

a(Partner)%{00003} + ", "+ %{00006}

or also

(Partner)%{00003}, %{00006}

 

Thanks for the quick response fidel.. 

 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira Service Desk

How the Telegram Integration for Jira helps Sergey's team take their support efficiency to the bank

...+ reading Fantasy). The same is true for him at the bank he works for: Efficiency is key when time literally equals money. Read on to learn how Sergey makes most of the time he has by...

199 views 0 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you