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

How to update a due Date

juan_lara March 17, 2022 edited

I created a variable in the automation like this 

Screen Shot 2022-03-17 at 10.11.53.png

 

this function should be a number, then I called it to modify the due Date

Screen Shot 2022-03-17 at 10.13.59.png

 

I got this error 

Screen Shot 2022-03-17 at 10.14.58.png

 

Does anyone know what is happening here?

3 answers

1 accepted

1 vote
Answer accepted
juan_lara March 17, 2022

@Mark Segall  I found this function and it works

{{#now}}func=plusDays({{date}}){{/}}

 

Thanks for your help

0 votes
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 17, 2022

Another thing to consider is that your compareTo function can return a positive or a negative so I believe the plusBusinessDays function will only work with a positive. 

So you may need to add an If condition to your rule where if {{date}} greater than 0 perform  plusBusinessDays(1) Else perform minusBusinessDays(1)

Also, if that doesn't fix it, I'd add a log action to your rule to validate the compareTo is in fact returning desired results.

juan_lara March 17, 2022

Hello @Mark Segall ,

 

I changed the compare condition to {{now.diff(issue.created).days.abs}} now always be positive number.

Screen Shot 2022-03-17 at 14.54.44.png

 

I added the log action, but the same error is still here

juan_lara March 17, 2022

@Mark Segall could you please explain to me where I need  to do this? So you may need to add an If condition to your rule where if {{date}} greater than 0 perform  plusBusinessDays(1) Else perform minusBusinessDays(1) 

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 17, 2022

Your change to the variable renders my last comment moot. Looking at the log, it looks like your date variable now returns 300 (at least on your test issue).  I'm not sure why you added ">=1" to your log entry though.  Is 300 what you're hoping to get from that diff?

juan_lara March 17, 2022

@Mark Segall that 300>= 1 was my mistake but is fixed now.  the problem is when I call the {{date}} inside {{now.plusDays({{date}})}}

that is the problem, I don't know if inside this function I need to use a different way to call the variable?

0 votes
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 17, 2022

Hi @juan_lara - Looks like a typo

You have PlusBussinesDays (note the spelling of busSines instead of businesS)

Should be plusBusinessDays

juan_lara March 17, 2022

Hello, @Mark Segall thanks for your answer. I did the changes but the same error. 

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, ace, atlassian community event, donation, girls who code, women in tech, malala fund, plan international, kudos, community badge, badge, atlassian badge, International Women’s month, International Women’s Day, women's month, women's day

10 for Change at Atlassian Community Events

Show up and give back by attending an Atlassian Community Event: we’ll donate $10 for every event attendee in March!

Join an Atlassian Community Event!
AUG Leaders

Upcoming Jira Events