Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Behaviour : How do I Set due date to after 7 days when summary change and on create

Omprakash Thamsetty
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 9, 2019

Hi,

When Summary change trying to set Due date after 7 days on creation. SetformValue is not setting the value to due date. What I am doing wrong



def sumField = getFieldById(getFieldChanged())
log.debug("summaryField value" + sumField)
def dueDate = getFieldByName("Due Date")
if(sumField.value){

Date dateNow = new Date(new java.text.SimpleDateFormat("dd-MMM-yyyy").format(new Date()+7))

sumField.setFormValue(dateNow)
log.debug("Date Now" + dateNow)

}else{

}

Any advise.

 

Thanks,

Om

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Anzar Khan October 7, 2019

Hi Om,

I think you are trying to set the due date after 7 days of creation but in the script, you are using the .setFormValue() method on the summary field.

Try

dueDate.setFormValue(dateNow)

instead.

Thanks and regards,

Anzar

TAGS
AUG Leaders

Atlassian Community Events