Default epic to newly created tickets

Lakshmi S March 18, 2021

Hi Team,

How to assign Epic to newly created tickets automatically.

3 answers

2 votes
Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 18, 2021

you would need some form of automation to do that (scriptrunner, automation for jira, etc). Obviously, you would want some sort of conditions least every new issue would be assigned to the epic which, in that scenario, your Epic becomes your project. ;-)

Lakshmi S March 18, 2021

Yes @Jack Brickey , I have script runner, JSU and JMWE addons. Tickets are created by people from other department who wants to get things done from us. So when the ticket is created, we would like to assign to EPIC. So anyone who creates a ticket with XXX as the project, we want to check if we can assign that ticket automatically to a specific epic.

Lakshmi S March 19, 2021

I found the solution here.

Link : https://library.adaptavist.com/entity/automatically-add-epic-link-into-issue-of-certain-type

import com.atlassian.jira.component.ComponentAccessor

// When you create an issue of issue type Story that will be under an Epic
final issueTypeName = "Story"

// The issue key of the Epic
final epicIssueKey = "EPIC-1"

if (issue.issueType.name != issueTypeName) {
return
}

def epicLinkCustomField = ComponentAccessor.customFieldManager.getCustomFieldObjects(issue).findByName("Epic Link")
def newEpic = ComponentAccessor.issueManager.getIssueByCurrentKey(epicIssueKey)

issue.setCustomFieldValue(epicLinkCustomField, newEpic)

1 vote
Deleted user March 22, 2021

Hi @Lakshmi S ,

The answer to your question is "Yes, you can update the Epic link field while creating the new ticket using the "Update any Issue" JSU post function. Upon issue creation it will be linked with existing EPIC".

Please follow the below steps for the same.
1. Create an EPIC with the epic name.
2. Provide the below post function. 
For example here, TJ-5 is an EPIC issue created already and with epic name, like my-epic-name
jsu-epic.png

3. Now, you can create a new issue that you want to link to the above EPIC.
4. The newly created issue gets linked with (my-epic-name) the EPIC, as shown:
jsu-new-issue-linked-epic.jpg

We have opened a support ticket, JSU-3405  to better track your request. However, we couldn't add you as a reporter. Please sign up using this link signup-here and share the user name/id. We'll then add you as the reporter and confirm.

Thanks,
Raja

0 votes
Drago Dolaptchiev March 18, 2021

You should be able to set default issue type by doing the following:

Project > Project Settings > Issue Types > Actions (Button) > Edit Issue Types


Here you will find a field that looks like this:
image.png

This should allow you to set a default Issue Type for your project (such as Epic). However, please keep in mind that this may not work, as there is overriding logic which will default to the last used issue type. 

You can refer to this thread for more details:
https://community.atlassian.com/t5/Jira-questions/Default-Issue-Types/qaq-p/930528 

 

I believe the best solution would be to set up some sort of automation (Jira has this too), as mentioned above.

Suggest an answer

Log in or Sign up to answer