Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

When a custom field is updated trigger a mail Edited

Hello All,

We'd like to improve the email by sending it to the custom field change for priority HIGH jira's..

Use Case : Custom filed 'Remediation Owner' is a Type - "Multi User" - when someone changes the value of that field (i.e., select another Owner) I need an e-mail to be sent out to the new Owner/s.

Note- this requirement is not for workflow status change or transition but only to custom filed value change at edit screen

 

Is there a way we can achieve this by script runner or any other supported way you guys have experienced, please share your thoughts..

 

Cheers

Mzm

 

 

4 answers

Hi Mzm,

You can solve this problem with our add-on Raley Notifications  

 

Here's how you approach it:

1) Create new Notification of type "issue updated"

2) Specify relevant project(s) and issue types(s)

3) In Fields updated section choose the custom field Remediation Owner

4) In JQL filter provide: priority = High

5) Provide subject value that make sense for your organization and in "To" section choose Remediation Owner again

6) Your message template will largely depend on your needs. Here's a simple basic that would do the thing:

===========================

Hello!<br/><br/>

Remediation owners have changed for $issue.key<br/>
New value is:</br>
#foreach ($ro in $issue.fields.customfield_12345)
$ro.displayName<br/>
#end

<br/><br/>
All the best,
Raley Notifications

===========================

 

Let us know if you need help setting this up.

Cheers,

Vladimir | RaleyApps

Thanks Vladimir, hope this option should work for us!


I've had a quick glance, I found in Jira Atlassian Marketplace and this seems available for free/ testing whilst, I’m not sure, this trial version would meet our business requirement needs.. let me play around and explore.. will keep you posted.

0 votes
Payne Community Leader Nov 21, 2019

Here is how we accomplished this for a similar scenario ... we removed the field from the edit screen, and in its place added a "circular" transition from a status back to itself. The transition uses a screen that has that one field on it. So now, rather than editing the issue, a user clicks the "Change ____" button, which pops up the screen with the field, and they change it there. Since it is a transition, we can then send an email to whoever needs it.

Thanks Payne for the workaround though, much appreciated!

Sorry to inform you, this will not work for us as we need something at edit screen only that to for field change. Moreover, we've 3 diff type of remediation fields, business requirement demands to have shoot email only to remediation owners but not to others like reporter etc… and we cannot afford ending up adding w/flow transitions/ screens for the same.

Forgot to mention/ share my findings I got it fixed by adding a small piece of customized code. It works perfectly as per the business requirement and it shoot email whenever ever value custom field change for priority issues. 

 

Below are the steps:

  • "Scriptrunner ->
  • Listener ->
  • Send a custom email ->
  • Events -> CustomFieldUpdatedEvent ->
  • Condition and Configuration -> {"issue.priority?.name == 'High' && cfValues['Remediation Stakeholders'] !=null"}
  • Email template -> "{add your mail template}"

Example

Dear User,

A Security Change Management has assigned/updated a High Priority Jira to you and requires your attention.

For more details, please refer to the link "$baseUrl/browse/${issue.key}"

<% if (mostRecentComment)

    out << "Last comment: " << mostRecentComment

%>

Best Regards,

${issue.reporter?.displayName}

  • Subject template -> "{add your subject template}"
  • To issue fields -> "{who need to notified, in my case Remediation Fields need to notify}".

 

Hope this helps if anyone looking for similar requirement.

Cheers

Mzm

MzM,
I'm trying to use your solution but it's not working for me. I have a single select list called Resolver Group. Whenever that field is updated, I need an email notification sent to the selected Jira group e.g.

Resolver Group = Development => notification sent to everyone in jira-development-group
Resolver Group = Operations => notification sent to everyone in jira-operations-group

I created a listener > Manage apps > Scriptrunner > Listeners > Create Listeners > "Send a custom email (non-issue events) with the following settings: 
- Project: A
- Events: CustomFieldUpdatedEvent
- Condition: "cfValues['Resolver Group'] == 'Development'"
- Email template: A Jira ticket has been assigned to your Resolver Group.
                            For details, refer to the link "$baseURL/browse/$[issue.key]"
- Subject template: JiraNotice:
- To Users in Groups: jira-development-group

I set the Resolver Group in an Issue to "Development" but nothing happened. Listener history states "Has not run yet". Am I missing a step? Once I get this working, I'll need a little help to expand on the condition to account for 5 resolver groups.

thx,
LS

If you want to do this in a couple clicks in a simple ui, you can use our app in place of ScriptRunner https://marketplace.atlassian.com/apps/1211069/notification-assistant-for-jira-email?hosting=server&tab=overview

Thank you for your quick response but I am limited to the existing plugins we have: Scriptrunner & JSU Automation Suite. 

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you