Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,360,061
Community Members
 
Community Events
168
Community Groups

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

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

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

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

Online AMA this week: Your project management questions answered by Jira Design Lead James Rotanson

We know that great teams require amazing project management chops. It's no surprise that great teams who use Jira have strong project managers, effective workflows, and secrets that bring planning ...

184 views 1 6
Read article

Atlassian Community Events