Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

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

Code wanted for default value for calculated field

George Carvill
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 6, 2014

I'm dumb and can't figure this out.

I have a custom calculated text fiedl. All I want is for it to display the value of another field.

How do I write the code in the 'Description' field to make that happen?

2 answers

1 accepted

0 votes
Answer accepted
George Carvill
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 20, 2014

I did make it work using the field index number, etc. But the field I wanted is the 'Sprint' field and the value I got was the index number of the sprint. Oh, well.

1 vote
Nic Brough -Adaptavist-
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 6, 2014

How are you doing the "custom calculated text field"? With the script runner, a plugin or something else? As it's a calculated field, I'm not sure why you're looking at the default value as the default value won't matter if you override any entered data with a calculation.

Whatever you answer, the response is going to be roughly issue.getCustomFieldValue(field), but it will vary depending on how you want to do it.

George Carvill
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 6, 2014

Good catch. I didn't mean "Default" but "Description." I fixed that.

I'm talking about a custom "Calculated Text Field" which is described on the page where I select the new custome field type like this:

Calculated Text Field

A calculated tex field. The formula is stored in the field description, inside an html comment.

George Carvill
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 6, 2014

I'm trying to put in a screen shot:

Nic Brough -Adaptavist-
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 6, 2014

Ok, before you do, a "calaculated text field" is not a standard function, it's being provided by a plugin somewhere, and don't know which one does it. I'm only really familiar with the hard-coded ones I've written, and the script runner, so I kind of need to know which plugin it is so I can skim the docs (I know roughly what needs doing in Jira terms, but not what the plugin needs from us)

George Carvill
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 8, 2014

This is what I am trying to do:

https://innovalog.atlassian.net/wiki/display/JMCF/JIRA+Misc+Custom+Fields#JIRAMiscCustomFields-calculatedtextfield

But this doesn't work:

<!-- @@Formula: issue.get("10300") -->

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, atlassian government cloud, fedramp, webinar, register for webinar, atlassian cloud webinar, fedramp moderate offering, work faster with cloud

Unlocking the future with Atlassian Government Cloud ☁️

Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.

Register Now
AUG Leaders

Upcoming Jira Events