How to remove additional label data from a custom field that is imported as Dimension and property

Hello,

I am having an issue whereby i want to display only the label as “Low, Medium, High, Critical” but i don’t know how to remove extra info that is coming from a custom field (which shows low,medium,high,critical as a label and color in JIRA RISKs.

This is how i added in the advance Settings:
#Inherent Risk Rating
[jira.customfield_1000]
data_type = “string”
dimension = true

But after import is successful.

When i use the Inherent Risk Rating to create a chart; This custom filed (Inherit Risk Rating) it show like this :

Exposure{id=1, name=‘Low’, description=‘An acceptable level of risk.’, severity=1, bgColor=java.awt.Color[r=20,g=137,b=44], fgColor=java.awt.Color[r=255,g=255,b=255]}Exposure{id=2, name=‘Medium’, description=‘Monitoring and weekly reporting is recommended.’, severity=2, bgColor=java.awt.Color[r=246,g=195,b=66], fgColor=java.awt.Col…Exposure{id=21, name=‘Critical’, description=‘Describe me’, severity=0, bgColor=java.awt.Color[r=164,g=25,b=6], fgColor=java.awt.Color[r=255,g=255,b=255]}Exposure{id=3, name=‘High’, description=‘Considerable business disruption likely. Immediate attention required.’, severity=3, bgColor=java.awt.Color[r=208,g=68,b=55],

So I need to remove all info except the name like Low, Medium, High, Critical.

Here are the screenshots as how it appears in eazyBI chart:

how the inherit Risk rating been calculated in JIRA:
Screen_Field_Issues_2

I am not sure if it’s possible to do and how to do it.

Any help would be highly appreciated.

Hi @Titu_Chowdhury

It seems like the customfield_1000 is a field that holds an array of values instead of one value. In this case, you can use custom Javascript code to extract the exact snippet of information you would like to use in eazyBI reports.

In your Advanced settings, you can define a new custom field “Inherent risk” and use a code like this to extract the value:

#Inherent Risk Name
[jira.customfield_inherentrisk]
name = "Inherent Risk"
data_type = “string”
dimension = true
javascript_code = '''
if(issue.fields.customfield_1000 && issue.fields.customfield_1000.name){
	issue.fields.customfield_inherentrisk = issue.fields.customfield_1000.name;
}
'''

Note that this is just an example of how you can extract specific values, and I would need to see the structure of this field to provide you with the exact code in your case.

Please reach out to support@eazybi.com with a JSON file from one of your Jira issues that has a value in this “Inherent Risk Rating” field, so that the structure of this field can be determined.
JSON file can be obtained through a REST API URL:

http://yourJiraSite. com/rest/api/latest/issue/ISSUE-NR

Best regards,
Nauris / eazyBI support

Hi nauris.malitis,

Thanks for the examples and I have managed to get the desire results.

Cheers!

1 Like