Is it possible to increment a custom number field in a post function?
I tried it with Update Any Issue Field (JSU) function, but it only let's me set it to one specific value, but not to currentValue+1.
An example of scriped postfunction to increment a custom number field:
CustomFieldManager cfManager = ComponentAccessor.getCustomFieldManager()
IssueManager issueManager = ComponentAccessor.getIssueManager()
// In "customfield_15201" replace 15201 by the ID of your custom number field
CustomField cf = cfManager.getCustomFieldObject("customfield_15201")
Double val = issue.getCustomFieldValue(cf) as Double
val = val + 1
val = 1
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 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