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

Can I update a date field with a relative value in JSD automation?

So I'm setting up some automation rules in JSD and one thing that would be particularly useful for our service desk is for date fields to be updated with relative values. 

A specific example of something I'm trying to create: I want public comments added to a ticket to update our "customer updated" date field to the current time. I can get as far as updating this field with a new value, but the options only seem to allow for me to update a date field with a predefined date/time. I've tried a number of obvious solutions (such as entering "now" or "now()" in the field), but it doesn't seem to accept anything but an exact date/time value. 

Any suggestions? I've tried out some plugins for automation to resolve this but nothing has been specifically geared towards service desk functionality, so I haven't found anything that caters for my requirements (for example, none of them recognise the difference between internal/public comments on a ticket).

Thanks in advance.

jsd date.png 

1 answer

1 accepted

HI. I know how it's do on plugin Power Scripts  (https://marketplace.atlassian.com/apps/43318/power-scripts-jira-script-automation?hosting=server&tab=overview)




You need
1. Create a sil script and add two lines (in script you must change   PROJECTKEY = your project key ; customfield_10204  = your customfield )

 

if(isPublicJSDComment(getLastComment(key)["id"]) and project == "PROJECTKEY")
     customfield_10204 = currentDate();



2. Add a new listener on event  "Issue commented"


and it's worked =)

 

 

 

 

 

 

 

Hi, Roman. Thanks for the response! I'm trying to set this up, but when I write this script in SIL manager, the "save" and "check" buttons are greyed out. Is this perhaps because I'm free-trialling Power Scripts, or is it to do with an issue in the syntax?

 

silmgr.PNG

HI. You need create  a new script

image.png
image.png



Worked like a dream, thank-you very much!

Suggest an answer

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

The Complete Guide to Atlassian for ITSM

Hi Atlassian Community! This is Teresa from the Atlassian team. My colleague Paul Buffington @Buff and I are excited to share a brand new ITSM resource we’ve created – "The Complete Guide to At...

2,187 views 15 22
Read article

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