Calculated value is broken each time issue is displayed

Hello,

I am using ScriptRunner 3.1.3 and have created a scripted CF called "Covered by TP".

Here is the script that is set in this CF:

 

def tp_coverage = getCustomFieldValue("TP Coverage")

if (tp_coverage == null)

{

    return "Not covered by TP"

}

else {

    return "Covered by TP"

 

At the first attempt, the script works well and returns the good value.

But each time an issue with this scripted CF is displayed or edited, the value gets broken:

When searching for issues based on this CF, if I add the condition AND "Covered by TP" = "Not covered by TP", issues with this field "Covered by TP" with value "Covered by TP" will be displayed. After some tests, all the isues edited or just displayed will fall into this behavior.

 

Can you help to fix this please?

 

Many thanks,

Best regards.

 

1 answer

This widget could not be displayed.

Hi Guillaume,

problem could be related to indexes. If you try to perform a reindex, JIRA search should display the correct value. Could you try?

Please let me know if my assumption is correct.

Regards,

Fabio

Hello Fabio, and thank you for your fast answer. I will type my answer here as I can't answer you with the answer form. When reindex is performed the problem is fixed, but then when the issues are displayed or edited after this, the same problem occurs. I use this field on a JIRA Pie Chart macro in a Confuence page, after a reindex is done it is all good, but when people starts to work on issues, the chart is getting wronger and wronger. Best regards.

Hello Guillaume, are u using some automation on your workflow (plugin postfunction, listener or something like that)? What Custom Field type is associated to "TP Coverage"?

Hello Fabio, for the stories and bugs we use the same workflow, and there is no automation in them. The field "TP coverage" is a field type implemented with the plugin SuiTest, Panel Filter CF type. Best regards.

Hi Guillaume, probably using that plugin there's a bug so that the specific issue is not reindexed after a change. Please, could you check log file in order to figure out if something wrong happens? Regards, fabio

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

533 views 3 19
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