Currently, we have routine issues where the status resets each week. This escalation service is working as intended. However, we are trying to incorporate the following script to adjust the system field 'DueDate' to be set for 7 days from the date when the escalation fires. The following code updates the date and returns the correct value but it doesn't appear to be committing the date of the provided ISSUEKEY.
Here is our code:
def customFieldManager = ComponentAccessor.getCustomFieldManager()
MutableIssue issue = im.getIssueObject('ISSUEKEY')
issue.setDueDate(new Timestamp((new Date() + 7).time))
May I know where you are running this script?
>>> If so check the order of post-function, it should be top of re-index post-function
2. Script Listener?
>>> if so you'll have to include "EventDispatchOption" method
def issueManager = ComponentAccessor.getIssueManager()
def appUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
//place duedate update code here
issueManager.updateIssue(appUser, issue, EventDispatchOption.ISSUE_UPDATED, false)
Hope this helps
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