Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Hi,
I want to add a link to an epic when I create a story. I'm trying to do that with groovy using script runner, but any other solution is good as well.
The Epic is known ( already exists).
The Story is newly created and I tried adding a post script function in create that will create the link to the epic.
Can someone help with this ?
I'm using Jira 7.2.8 and Script runner 5.3.7
Thanks,
Alon
So you want this done dynamically? That is why trying to use Script Runner? Normally you do this from a Backlog or simply create screen...
but when using Script Runner you should use something like this
CustomField epicLink = customFieldManager.getCustomFieldObjectByName('Epic Link');issue.setCustomFieldValue(epicLink,source_issue)
Thanks for your answer.
Yes I meant that the link should be added automatically, not manually, took that for granted and forgot to mention it ...
Adding it manually works fine.
I tried your suggestion, but it doesn't work for me. Does it wok for you ?
I also tried using this:
CustomField epicLinkField = customFieldManager.getCustomFieldObjects(issue).find{it.name == 'Epic Link'}
epicLinkField.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(epicLinkField), epic),new DefaultIssueChangeHolder())
Which I read was the right way to update the epic link field but this doesn't work.
Thanks,
Alon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.