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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Email post function

I would like to send out a email to team lead and PM  when ever there is a big assigned to one of the development  team members . 

I created a post function for the assigned defect work flow . 

 

I want the condition where the defect type is Bug and the status is assigned defect  issue.issueType.name == 'Bug' & issue.status=='Assigned Defect'

email template to 

which tell that defect is assigned to memeber of your team : asssigneee name 

 

this post function needs to trigger and send email only when the defect is assgigned to member of dev team 

 

How do i achieve this using post function 

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Muhammad Moazzam Hassan
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.
Nov 06, 2023

This can not be achieved by using the post function because it triggers on issue transition and your trigger is based on issue type and assignee which can only be done via Automation Rule.

if you want to do it via the post function then you have to add the specific transition for it and have to validate the assignee and issue type via validator so the transition can only be used as per your condition.

I have added the post function when the defect  is assigned.

Any time this transition occurs, I would like the email to go to 3other people in the team besides the assignee.

Zaldy Parian
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.
Nov 09, 2023

Hi @Garden16_ 

Can I please ask, how did you manage to get the Send a custom email in Post Function?
I checked in my workflow, and I could not find it from the list of functions...

post_function.png

Muhammad Moazzam Hassan
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.
Nov 09, 2023

Hi @Garden16_ ,

Now you can trigger a custom event from which you can send email or you can use automation rule to send email, but for automation rule it must have to find on which transition you want to send so for that on this transition you have to update one more field so on that field basis you can send email.

 Added email  using script runPostfunction.PNGner 

Like Muhammad Moazzam Hassan likes this
Muhammad Moazzam Hassan
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.
Nov 13, 2023

This is good.

Zaldy Parian
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.
Nov 13, 2023

Hi @Garden16_ ,

Could you please share the steps to add a post function from ScriptRunner?

click on the transition and select post function and select the radio button for sending custom email. Click add and  add the below for functionality

condition : 

issue.issueType.name == 'Bug'
Email template : 
Hello,

Defect ${issue.key} has been assigned to ${issue.assignee?.displayName}
 
Defect Summary:$issue.summary

<% if (mostRecentComment)
    out << "Last comment: " << mostRecentComment
%>
subject template 
The Defect $issue is now in Assigned status
Zaldy Parian
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.
Nov 14, 2023

Thanks. We could have different instance of Jira. We are using Jira Service Management (JSM) Cloud instance. And I don't see any option for sending email under post function tab.  This is what is available to me, there no option to send custom email...

post_function1.png

TAGS
AUG Leaders

Atlassian Community Events