Racking my brain on this one, hope you guys can help.
I'm trying to create a groovy script that will clear out the value of a custom field upon issue creation, but only if it's a clone of another ticket. This is our workaround for avoiding the propagation of custom field data when creating a clone.
Here's my code thus far; no failures, but no results:
import com.atlassian.jira.component.ComponentAccessor
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def clonedIssues = ComponentAccessor.getIssueLinkManager().getOutwardLinks(issue.getId())?.findAll {it.issueLinkType.outward == "Clones"};
if (clonedIssues) {
def cfpival = customFieldManager.getCustomFieldObjectByName("PI/Sprint Value") //Set custom text field with current date & time if blank
issue.setCustomFieldValue(cfpival, null)
}
I should note that the post func is at the very top of the list of functions to be executed, even above 'Create the issue originally'.
Any ideas?
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.