You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.
Join groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
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?
Atlassian's marketplace partners have had a very productive start to 2021! Since our last roundup, our developer community has added over 160 new cloud apps to the Atlassian Marketplace to help you...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events