Hi @Jamie Echlin [Adaptavist],
Using your script runner plugin, I have a transition that simply creates a couple of sub-tasks and it works perfectly. However, if the parent issue is in an Epic the sub-tasks are created and added to the Epic. As you know a sub-task cannot be assigned to an Epic under normal usage. I have no script or post-funtion to do this and have even tried adding a postfunction on the sub-tasks create transition to clear the "Epic-Link" field however that does not work. Do you have any ideas on how I can prevent this from happening?
Thanks in advance
Hi John,
You will need to provide the following code to the "Additional issue actions" field in the configuration of the Create a Sub-task post-function.
checkLink = {link -> false};
By doing that, new sub-tasks of the stories that belong to an Epic will not be listed under the "Issues in Epic" section of that Epic.
You can take a look at the following documentation to get more information about what checkLink is doing:
Gautam, can you give some info about the versions of Jira and ScriptRunner your instance is running?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just an update for those finding their way here: see my answer at https://answers.atlassian.com/questions/40003636. You can set/clear the Epic Link just like any other custom field in the Additional Actions, along with controlling link copying behavior separately.
checkLink = {link -> false}; def epic = customFieldManager.getCustomFieldObjects(issue).find {it.name == 'Epic Link'} issue.setCustomFieldValue(epic, null)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That didn't work for me. I am using JIRA 6.2, Script runner - 3.0.16. Neither the subtasks are created with the "Epic Link" set to null , nor the epic stops listing the subtasks under the story.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, yeah, I should have paid closer attention to the version numbers. All bets are off with older unsupported versions of ScriptRunner & JIRA. A lot of those post-functions were rewritten to make use of deeper JIRA validation services to prevent this sort of misbehaviour.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
I have the exact same issue and when I try to add "checkLink = {link -> false};" on my script runner code it is giving an error on the "-" saying " Expecting '}', found '-' "
My current little code just validates one field and create sub-tasks if that specific field is with the correct value.
Any ideas? Version:5.3.26
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.
Hi, @Graciela Persch Severo @Derek Sheeman
Same here the syntax didn't work for me, but the following worked
checkLink = {link -> false}
def epicLink = customFieldManager.getCustomFieldObjects(issue).find {it.name == 'Epic Link'}
issue.setCustomFieldValue(epicLink, null)
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.