Hi,
I want to set date on a custom field using script runner. I am using the script below but it is giving me the date 1 month later not the current date. I have added the code in a Post Function.
code:
def csDate2 = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Approved On")
Timestamp csDate1Value = (Timestamp) issue.getCreated()
Date csNewDateValue = new Date(csDate1Value.getTime() + 30*24*60*60*1000);
csDate2.updateValue(null, issue, new ModifiedValue("", (Object) csNewDateValue), new DefaultIssueChangeHolder())
Kindly advice
Thanks
Swarna