Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable use Smart Variables as function parameters

Margots Kapacs April 27, 2023

 

Hi,

It appears that the smart variables don't render when used within functions. Here is variable DayOfStay that i pass into the function plusDays, however. It renders to nothing. How to use variable within function if possible. Thank you

 

 

image.png

2 answers

1 accepted

2 votes
Answer accepted
Alex Koxaras _Relational_
Community Champion
April 27, 2023

Hi @Margots Kapacs 

If DayOfStay is a custom variable created with the Variable component, then simply write on your smart value the .asNumber method:

{{issue.Check-in.plusDays(DayOfStay.asNumber)}}

Keep in mind that custom variable are treated, to my knowledge, as text. So when you try to add a text to a date, the date becomes null.

Let me know if that solved your problem! 

Margots Kapacs April 29, 2023

Thank you Alex. It works by adding asNumber function at the end. Thank you for helping

0 votes
Jan-Hendrik Spieth
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.
April 27, 2023

Interesting! Suggestions/thoughts:
Does the Date Of Stay field expect a certain formatting, that is, does it work if you e.g. add ".jqlDate" at the end?

Then again, it sounds very much like this weird problem: https://community.atlassian.com/t5/Jira-Software-questions/plusdays-function-not-working-when-I-pass-in-a-variable/qaq-p/1500605 ... from 2020. Is that really still a thing?? And does that workaround still do the trick, maybe? oO

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, atlassian community, loom ai, atlassian loom ai, loom, atlassian ai, record recaps of meetings, meeting recaps, loom recaps, share meeting recaps,

Loom’s guide to great meetings 📹

Join us to learn how your team can stay fully engaged in meetings without worrying about writing everything down. Dive into Loom's newest feature, Loom AI for meetings, which automatically takes notes and tracks action items.

Register today!
AUG Leaders

Atlassian Community Events