Forums

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

MISC Custom Fields: Calculated text field

Stas December 16, 2014

Hi! I'm using JIRA 6.2.5

 

I'm trying to use formula, that makes url:

<!-- @@Formula: "http://mysite.ru/packet/view/" + issue.get("customfield_11019")
-->

but i've got 2 problems

1) url is not active (cant tap on it)

2) if customfield 11019 is empty - i get this http://mysite.ru/packet/view/null (i dont need any value if empty)

what i'm doing wrong?

2 answers

1 accepted

1 vote
Answer accepted
David _old account_
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.
December 17, 2014

1) you might try to return a valid html link (<a href=...)

2) you need to test your custom field value against null and return null then:

if (issue.get("customfield_11019") == null) return null;

 

Stas December 17, 2014

1) i dont know where to put it in formula(( 2) works! thanks!!!

1 vote
David _old account_
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.
December 17, 2014

{code}return "<a href=\"http://..."+issue.get(...)+"\">see details</a>"{code}

Stas
Contributor
December 17, 2014

not working. maybe i'm doing it wrong

Stas
Contributor
December 17, 2014

O!!! I got it!!! thanks!!!!! works Great!!

Dominic Baldin
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 1, 2015

Can you share where you placed this in your formula?

Dominic Baldin
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 1, 2015

Actually your entire formula would be very helpful.

Tim Thompson June 2, 2016

Help - trying the same thing.

THIS WORKS:


<!-- @@Formula:
return "https://collaborate.mysite.com/display/EETSTSS/"+issue.get("customfield_14729");
-->

but, of course, is displayed as text and not a linkable URL

THIS DOESN'T WORK:

<!-- @@Formula:
return "<a href='https://collaborate.mysite.com/display/EETSTSS/"+issue.get(customfield_14729)+"'>Link here</a>";
-->

Nothing is displayed. (I tried \" characters instead of ' too).

I must be blind.... what am I doing wrong?

David _old account_
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.
June 2, 2016

Your formulas are not visible. You need to use code blocks (last icon to the right) to paste your snippets.

christine matt September 19, 2017

Hi, I'm having the same problem as Tim Thompson, does someone has the solution?

David Fischer
Community Champion
September 19, 2017

Actually, this will not be possible until https://innovalog.atlassian.net/browse/JMCF-209 is resolved (in the upcoming JMCF 2.0). This is a limitation of Jira.

christine matt September 25, 2017

It works!
My formula:

<!-- @@Formula:
return "<a href=\"https://..." + issue.get("issuekey") +"..."+"\">see details</a>"
-->

Suggest an answer

Log in or Sign up to answer