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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,551,726
Community Members
 
Community Events
184
Community Groups

Unable use Smart Variables as function parameters

 

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 Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 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! 

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.
Apr 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
Site Admin
TAGS
AUG Leaders

Atlassian Community Events