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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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
Asked in Jira Service Desk

Calling all Insight users, we need your help!

Hello Insight users,  As part of our (Mindville's) acquisition by Atlassian, our training team is looking to build some new Insight training materials. It would really helpful if you can ...

55 views 0 0
View question

Community Events

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

Events near you