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

Date Time Custom Field addition and subtraction with Automation

Nick Green March 2, 2021

Hello!

I am having a difficult time using the Automation for JSD to work with some date time fields and plain text custom fields.

We have a few date time custom fields, which is populated by a script to set the date and time on card creation (but this time will not be the time that the card was created, it will be a time when an issue was detected).

This script also passes a numeric value to a plain text field, example: 20, or 40, or 60 - this represents minutes.

Now what I need to do is take the value in the "Date Time" custom field, and add (plus) the value from "Extra Time", example (the time is shown in this annoying format):

Date Time: Mar 02, 2021, 12:00 AM

Extra time: 20

Using Automation for JSD, I have attempted to use the Smart Value, but it seems that you can't .plus or .minus a set value from a different date time custom field.

I've tried:

Edit Issue -> Custom Field Name

{{issue.Date Time.plus(20)}}

But this clears the 3rd date time custom field where I need to display this value.

I'm at a bit of a loss on this one. Is there anyone who has done something similar, or knows of some automagical way of doing this?

Keep well,
Nick

1 answer

1 accepted

2 votes
Answer accepted
Mykenna Cepek
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 2, 2021

Instead of using:

.plus(20)

on the datetime field, use this instead:

.plusMinutes(20)

 

From the docs here:

Screen Shot 2021-03-02 at 10.23.00 AM.png

Nick Green March 2, 2021

Oh my goodness. I can't believe that I was that blind.

Thank you Mykenna! Yes, that did indeed work.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events