Epic Link from Java API

Hi Everyone,

Can some one please share the code that works for creating Epic Link programatically. I have tried so many options and nothing works. Doesn't give any error, how ever my Epic link is not showing on the screen even though I have configured the Epic Link screen configs correctly. Please help on this!

2 answers

0 vote
Tayyab Bashir Community Champion Sep 06, 2017

Possible reason for why epic link is not showing. 

To set epic links, you need edit issue permission in both the epic and the issue you are linking it to. 
So make sure you have the permissions for Epic Link. 
If you are in CCB role you would automatically have that permissions. 

I checked the permission. The user I am using is admin user and has all required privileges. My case is, I am trying to create the issue and epic link of that programatically. After creating the issue, I can edit the issue and assign Epic Link without any issue. But the problem is, Epic Link is not set when I do it through my program. Same user. I think permission is all set.

Tayyab Bashir Community Champion Sep 06, 2017

Being an admin user has nothing to do with project level user permissions. Admin permissions are just for other administrative stuff.


Make sure the user you are using is added in the project role CCB.


And the user should be CCB in all epic's project and the target issue's project as well.
Kindly also share the code that you're doing this with?

Great Thanks Tayyab,

I can create the epic link from JIRA UI without any issue for the same user. So I assmue same thing should be able to do using my program. Isn't it?

String custFieldValue = "PT-01" //This is my Epic Key
CustomFieldManager cfManager = ComponentAccessor.getCustomFieldManager();
CustomField jiraCustomField = cfMgr.getCustomFieldObjectByName(Constants.EPIC_LINK);
MutableIssue epicIssueObject = ComponentAccessor.getIssueManager().getIssueObject(custFieldValue);

if(epicIssueObject != null) {
newJiraIssue.setCustomFieldValue(jiraCustomField, custFieldValue);
} else {
log.info("Epic Link " + custFieldValue + " is not available.");
}

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

510 views 1 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you