This is pretty much the exact question here: https://answers.atlassian.com/questions/18812102
The problem is that the answer given there is wrong, as is mentioned by the initial poster.
checkLink = {link ->
false
}
does NOT clear the Epic Link and I see no info in the documentation on how to do this. Googling it I only find the above question over and over again.
Note: I very much like the fact that the command above does not clear the Epic Link; it's good to separate all links from Epic Links. However, I'd like to know what I need to do to specifically clear just the Epic Link.
Any help please?
As discussed, the Epic Link is actually its own separate custom field, distinct from regular links. As such, you'll need to clear it separately from the checkLinks closure. You can do both (set checkLink and clear the Epic Link), or just do the one that suits you in the Additional Actions section of a post function. To clear it, just set the value to null.
checkLink = {link -> false}; def epic = customFieldManager.getCustomFieldObjects(issue).find {it.name == 'Epic Link'} issue.setCustomFieldValue(epic, null)
Take note that your mileage may vary on accessing the Epic Link through the custom field manager, depending on what version of JIRA and ScriptRunner you're using. I tested the above on JIRA 7.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah it's giving me an error. Also, I think if checkLink would work for Epic Links, it would work with the blanket link -> false so I doubt this will lead us anywhere.
image2016-8-24 14:12:48.png
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Using JIRA 7.1.1 and Script Runner 4.3.5
I'll try your solution when I get to work tomorrow.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
or can you try to explicitly try mentioning "Epic LInk" in the additional condition section like in example - checkLink = {link -> link.issueLinkType.name !=
"Cloners"
} , so instead of cloners you can mention "Epic Link"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was able to clear the epic link field when auto-creating sub-tasks by adding the following:
checkLink = {link -> link.issueLinkType.name != "Epic-Story Link"}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What's the JIRA and ScriptRunner Version that you are using?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
it's working here - https://answers.atlassian.com/questions/12258914
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.