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

rTrack Support October 7, 2016

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

1 vote
Answer accepted
Fidel Castro
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.
October 7, 2016

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

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

conf-1.png

 

Once configured, your transition should look like this:

conf-2.png

conf-2.png

rTrack Support October 7, 2016

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

 

Fidel Castro
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.
October 7, 2016

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.

rTrack Support October 11, 2016

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 .

 

rTrack Support October 11, 2016

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

 

Fidel Castro
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.
October 11, 2016

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".

rTrack Support October 11, 2016

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 

Fidel Castro
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.
October 11, 2016

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?

rTrack Support October 11, 2016

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

 

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

rTrack Support October 11, 2016

Scenario.png

 

scenario.png

rTrack Support October 11, 2016

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 .

 

Fidel Castro
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.
October 11, 2016

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"))
rTrack Support October 11, 2016

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 .

 

 

Fidel Castro
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.
October 11, 2016

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

To_send_email.png

rTrack Support October 11, 2016

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 ??

 

Fidel Castro
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.
October 11, 2016

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.

rTrack Support October 11, 2016

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 .

Fidel Castro
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.
October 11, 2016

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

0 votes
Fidel Castro
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.
May 20, 2017

More simple:

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

or also

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

 

rTrack Support May 20, 2017

Thanks for the quick response fidel.. 

 

0 votes
Fidel Castro
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.
October 7, 2016

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

rTrack Support October 7, 2016

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 ..

 

 

rTrack Support May 19, 2017

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,

Fidel Castro
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.
May 20, 2017

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.

rTrack Support May 20, 2017

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???. 

Suggest an answer

Log in or Sign up to answer