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

Date and time functions

Is it possible to use a variable or a custom field when formatting the date, e.g. 

{{now().plusHours({{"customfield_10286"}})

2 answers

Instead of a constant value in the plusHours () function I need to be able to use a variable from a field such as a numeric or a drop-down list, that's all.
If possible, please give me an example and syntax.
While browsing this thread, I have doubts if it is possible here 

0 votes
John Funk Community Leader May 28, 2021

Calling the expert - @Bill Sheboy 

Hi @Kamil Blicharski and @John Funk 

I note you are trying to nest the smart values and wrap a number with quotation marks, which could be part of the issue.  Depending upon your custom field type, maybe try this:

{{now().plusHours(issue.customfield_10286.asNumber())}}

If that does not help, what problem are you trying to solve?  Knowing that may reveal alternative solutions.

Best regards,

Bill

Like John Funk likes this
John Funk Community Leader May 31, 2021

Hi Kamil - please make your responses in the same thread here so that future readers can follow the conversation.

Did you try the syntax provided by Bill above? 

Instead of a constant value in the plusHours () function I need to be able to use a variable from a field such as a numeric or a drop-down list, that's all.
If possible, please give me an example and syntax.
While browsing this thread, I have doubts if it is possible here 

Hi @Kamil Blicharski 

With automation rules, it is not yet possible to use a created variable as a parameter to a function.  If you just need to use a field from the issue, that does work.  Please see the example I provided.

Like John Funk likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Jira Work Management

Lessons from Vilius Zigmantas’ path to Continuous Process Improvement at GeoComply

  “Organizations are made of people who create and follow processes which are constantly changing and are in need to be supported and nurtured… this is the spot where I realized I can br...

1,644 views 9 18
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