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

How to link new story to an Epic automatically while creating??

Hello All,

When creating a new story it has to link automatically to an particular Epic.

Thanks in advance,

ch

2 answers

1 accepted

0 votes
Answer accepted
Leo Community Leader Jan 16, 2020 • edited

Hi @Ch,

Below Behaviour script may give you some idea

def labels = getFieldByName("Labels")
def lbls = labels.getFormValue() as String

if(lbls.contains("label name")){
getFieldByName("Epic Link").setFormValue("JRA-3")

Note: you need place this script for Labels field

 

BR,
Leo 

Hi @Leo 

It is not working.
Epic.PNG

Leo Community Leader Jan 17, 2020

Is it not updating Epic Link field? can you include else part in the script and try to update other epic for testing?

tried with the below script still it is not working

def labels = getFieldByName("Labels")
def lbls = labels.getFormValue() as String

if(lbls.contains("Test")){
getFieldByName("Epic Link").setFormValue("DONE-12")
} else {
getFieldByName("Epic Link").setFormValue("DONE-14")
}

Hi @Leo

Epic link is now updating with the below script.

def labels = getFieldById(getFieldChanged())
String lbls = labels.getValue() as String

if(lbls.contains("Test1")) {
getFieldByName("Epic Link").setFormValue("DONE-12")
} else if(lbls.contains("Test")) {
getFieldByName("Epic Link").setFormValue("DONE-14")
}

Thanks for the help.

0 votes

Hi @Ch 

 

If you can open the Epic issue and add issue from that page, it will be linked to that particular Epic automatically.

Hi @Lenin Raj Rajasekaran

Thanks for the reply.

What i mean is when user creating a story it should automatically populate required Epic in Epic Link field depends on Label selection on create screen.

Thanks,

ch

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