I'm trying to set a date in the field "Last working day", which is 3 months after the creation date of the issue. The field remains blank and the log of the script shows the creation date. Not the value I expected. what am I doing wrong in the calculation, and in setting the value in the date field?
I use Scriptrunner in a post function.
def csDate2 = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Last working day")
Timestamp csDate1Value = (Timestamp) issue.getCreated()
Date csNewDateValue = new Date(csDate1Value.getTime() + 90*24*60*60*1000);
// the date field expects a Timespamp
log.warn("Logging:" + csNewDateValue.toTimestamp() )
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