when moving operations, the sprint field is not emptied. This causes the operations with wrong sprint on other boards. We have filter related boards. Is there a way I can clear the sprint field on the move? Is it possible with Scriptrunner? If yes how? And how can I use Scriptrunner to clear Cutomfields.
Here is sample code for a Move Issue event listener:
// optionally, check from/to project and conditionally execute...
def issueManager = ComponentAccessor.getComponent(IssueManager)
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def sprintCf = customFieldManager.getCustomFieldObjectByName("Sprint")
def user = event.user
def issue = issueManager.getIssueObject(event.issue.id)
def updateIssueRequest = UpdateIssueRequest.builder().
issueManager.updateIssue(event.user, issue, updateIssueRequest.build())
That's a more complicated question... see https://community.atlassian.com/t5/Answers-Developer-Questions/How-to-detect-if-an-issue-is-a-clone-in-a-listener-at/qaq-p/562675. If you are on jira 7.5 you could do it on IssueLinkCreated and check if it's the cloners link I guess.
Moving an issue tries to retain as much of the issue as the target project allows for, and as Sprint is a global field, it's not going to clear it.
You are right you can do it with ScriptRunner - a listener could be scripted to catch "issue moved", check you want to lose the sprint and clear it (and other fields) by setting them to "null".
Project managers know this problem: A “mountain of work” lays in front of you, and you don’t know how and where to tackle them. Different to-dos lie ahead, but just one task after the other can be ha...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events