Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automatically tag a user in a comment when few custom fields are updated

Lakshmi CH
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.
August 23, 2022

Hi Team,

We have a requirement that basically the problem we are trying to solve is that particular user needs to know when one of some custom fields are updated. We have asked the people making those changes in the jira ticket to tag user in a comment anytime they make a change but sometimes it is missed, so we were trying to see if there was some automated solution to notify user of those field changes - but not overwhelm user inbox.

We have JMWE, Script runner and JSU addons , and we are on jira server 8.20.6.

Thanks!

2 answers

1 accepted

1 vote
Answer accepted
Avinash Bhagawati {Appfire}
Community Champion
August 29, 2022

Hi @Lakshmi CH ,

Using Email Issue-JMWE Post function or Comment Issue- Post function within event based actions you will be able to achieve your requirement.

2022-08-29_14-31-54.png

Thanks,
Avinash

Lakshmi CH
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.
August 29, 2022

This is perfect @Avinash Bhagawati {Appfire} . Thank you so much for your assistance. I used "Issue Updated" event. User was complaining they are started receiving lot of notifications.

Avinash Bhagawati {Appfire}
Community Champion
August 29, 2022

Hi @Lakshmi CH ,

Thanks for your response on this. Can you please make sure to use "Issue Field Value changed" event with field you would like to monitor. Also, Issue Updated event triggers even if you make any modify any field in the issue. Probably, this is triggering the many notifications to users.

Additionally, for example in my above screenshot. Whenever the value of field "Change Type" has been changed to "Standard" then automation commented will added to the ticket.

Thanks,
Avinash

0 votes
Rik de Valk
Community Champion
August 23, 2022

Hi @Lakshmi CH

I would suggest to set up a Scripted Listener using ScriptRunner.

This Listener would listen to the event 'Issue Updated'. And using Groovy you can check the changelog for the event.

 

GenericValue changeLog = event.getChangeLog();
You can iterate through the changelog and see if the specific fields you want were updated. In the below example I check Acceptance criteria and Story points. And I set a variable fieldsChanged to true if one of these was updated.
for (Iterator<GenericValue> iterator = changeItems.iterator(); iterator.hasNext();){

    GenericValue changetemp = (GenericValue) iterator.next();

    String field = changetemp.getString("field")

    if(field == "Acceptance criteria" || field == "Story points") {

        fieldsChanged = true

    }

}
And when the field(s) were changed, you can have the script do whatever you would like it to do; send an email this person who needs to be informed, or add a comment mentioning this user.
Have a nice day!

Suggest an answer

Log in or Sign up to answer