Missed Team ’24? Catch up on announcements here.

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

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

Jack Noble July 31, 2019

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

1 vote
Answer accepted
Roman Kersky
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.
July 31, 2019

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 =)

 

 

 

 

 

 

 

Jack Noble August 7, 2019

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

Roman Kersky
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.
August 7, 2019

HI. You need create  a new script

image.png
image.png



Jack Noble August 7, 2019

Worked like a dream, thank-you very much!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events