MISC Custom Fields: Calculated text field based on issuetype

I am trying to populate a text field based on issue type:

<!-- @@Formula:
String s = issue.get("issuetype").getName();
if (s == "Other") return "This is of issue type other";

s is getting populated with "Other", however, when I compare it in if statement I do not see the output. 


5 answers

1 accepted

1 vote
Accepted answer
Peter Bengov Community Champion Apr 16, 2015

You can cast the value, that should work

if (s.equals("Change Relationship")) 
	return (int)issue.get("customfield_11501");
1 vote
Peter Bengov Community Champion Apr 09, 2015



Awesome! Thanks Peter smile

Peter Bengov Community Champion Apr 10, 2015

You are welcome

Hi Peter,

I am trying to calculate a number field but I do not want to display the decimal point. Is there a way to convert a field value to whole number?

This is giving no result. customfield_11501 value is 51 and it displays 51.0 when I display it as it is.

if (s.equals("Change Relationship"))
return numberTool.format(value);



Yup, that worked and it's Java implementation. Things makes so much more sense now laugh

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,749 views 18 21
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you