Forums

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

How to automatically email a User (selected from customField) once event triggered?

MATT Adair (UK)
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 16, 2019

I am in the middle of trying to create a script/automated task to email a customfield user or comment with reference to a custom fields once an event has been triggered.

 

The process is;

1. When CustomField1 (Days until..) reaches below 60 an event is triggered

2. CustomField2 (Manager) will then be selected from its UserPicker field and emailed or tagged/mentioned in a comment about this (either way works)

I have tried using automation, however can't find a way to grab the user and email them, or find a way to reference the selected User from the CustomField into a comment.

 

Any advice would be greatly appreciated.

1 answer

0 votes
Andrew Laden
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 16, 2019

What are you using for the automation? Hard to give an answer without that information.

That said, if you are firing a custom event, you can just add a notification rule to the notification policy to that event that can email users in a user picker custom field. 

MATT Adair (UK)
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 17, 2019

We are using automation for Jira Lite.

I was using a jql query to schedule a comment action.

Andrew Laden
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 17, 2019

If you are using the "Lite" version, you are limited in that you don't have access to

  • Comment on issue Action
  • Send Email Action

https://docs.automationforjira.com/getting-started/getting-the-right-version.html#pro-vs-lite

Which makes this a little difficult. :)

But you do have access to the publish event action. So you can leverage that.

  1. Create a new Event (System Menu -> Events) Call it "coming due soon"
    1. Select the Generic Event template. This controls the email format that will be sent out.
  2. Now when you look at the notification scheme for your project, you should see your new custom event listed. Add a Recipient of a "User Custom Field Value" pointing to your custom field.
  3. In automation, Create a scheduled job with a JQL condition matching what you want. The Action should be "Publish Event" with your custom event type.

So the automation will run on its schedule, come up with the list of issues, and for each one fire/publish the "Coming Due Soon" event, which will trigger an email to the user listed in the custom field.

 

If you end up getting the full version of automation, you will have options to use the send email or comment on issue action. and you can look at using "Smart Values" to get the user information to email as well as customize the email more.

 

(note I am assuming Server version since you didn't say cloud. If you are using cloud then you have access to comment and email, but not publish event, so then this doesn't apply.)

Suggest an answer

Log in or Sign up to answer