cancel
Showing results for
Did you mean:
See all
See all
##### Top groups
Explore all groups
##### Support
Deleted user
0 / 0 points
Next:

Challenges
• Global
• Feed

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Recognition
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Check back soon to give more kudos.

Past Kudos Given
You haven't given any kudos yet. Share the love above and you'll see it here.

# It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

# text formula question

hi,

I want to create an identification formula,

One Calculated number field (ID:12002) is created and works well.

I want to convert the value into text as

if value is null then null

if value >4 then "Over 4 wks"

if value >2 then "2~4 wks"

if value >0 then "0~2 wks"

I tried to use below 2 method, but failed

<!-- @@Formula:
Integer i = issue.get("customfield_12002");
if (i==null) return null;
if (i > 4) return "Over 4 wks";
if (i > 2) return "2~4 wks";
return "0~2 wks";
-->

or

<!-- @@Formula:
Integer i = issue.get("customfield_12002");
if (i==null) return null;
else if (i > 4) return "Over 4 wks";
else if (i > 2) return "2~4 wks";
else return "0~2 wks";
-->

I assume you already have a calculated number field. Let's say its ID is 12345, hence its name is "customfield_12345".

In your Calculated Text Field, you would do something like:

 ``

I modified the code as below, then it works

<!-- @@Formula:
if (issue.get("customfield_12002")==null) return null;
else if (issue.get("customfield_12002") > 4) return "Over 4 wks";
else if (issue.get("customfield_12002") > 2) return "2~4 wks";
else return "0~2 wks";
-->

###### TAGS
Community showcase
Published in Jira

### The benefits of using Jira in different departments

Jira is a great tool to use across different departments. Forget that paperwork – switch to Jira and get that tasks done smoothly. Marketing Jira allows for a complete digital transformation of you...

109 views 0 7

### Community Events

Connect with like-minded Atlassian users at free events near you!

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.