Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,359,849
Community Members
 
Community Events
168
Community Groups

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 # people like this

Would it be possible to use the syntax the other way around? So instead of using now to solve a math expression, I would would want to use a custom field as input.

 

Example: {{issue.customfield_100xx.minusBusinessDays(3)}}

 

In which my custom field would represent a delivery date (arrival at customer) and the output would be my due date (departure for transport).

John Funk Community Leader Mar 08, 2022

@Yannick Roethof  - Welcome to the Atlassian Community!

Sure, you can do that. 

Like Yannick Roethof 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
Asked in Jira Work Management

CLOSED Ask Me Anything (AMA): Project management at scale with Design Lead James Rotanson

UPDATE:  It's a wrap for our first community AMA on Jira Work Management. Thanks to everyone for taking part and sharing. Feel free to keep the discussion going! Share your questions now Hi...

1,002 views 18 11
View question

Atlassian Community Events