Forums

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

(Scriptrunner) auto create stories WITHIN the epic.

Robert Anthony
May 21, 2019

So I know that auto creating issue types with scriptrunner is pretty easy with the provided scripts, and im using the Clone an issue, create a link script, but it's not quite solving my problem. I have a post function on an epic that I want to auto create 3 stories WITHIN the epic on the transition, not just creating a link between the issues after auto create. Does that make sense? Any help would be great. 

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 Champions.
November 6, 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.

Garden16_
November 7, 2023

assign defect transition.PNG

Garden16_
November 7, 2023

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 Champions.
November 9, 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 Champions.
November 9, 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.

Garden16_
November 13, 2023

 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 Champions.
November 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 Champions.
November 13, 2023

Hi @Garden16_ ,

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

Garden16_
November 14, 2023

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