How to get values of a cascading field to 2 separate custom field?

Rumceisz March 26, 2013

Hi,

we have a cascading field but we cannot create a report from that: because we need both level separately.

Do you know a solution for that?

Thanks,

Rumi

2 answers

1 accepted

1 vote
Answer accepted
JamieA
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.
March 26, 2013

There is a code example here for getting the two parts of a cascading select:

https://jamieechlin.atlassian.net/browse/GRV-42?focusedCommentId=45504&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-45504

Personally I'd consider solving this problem with an excel macro rather than redundantly storing both parts separately.

Rumceisz March 26, 2013

Hi Jamie,

many thanks for your support!

Hence I am not acquinted with that script, can I ask how can I define the 2 separate custom fields?

Thanks again,

Rumi

JamieA
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.
March 27, 2013

Start at https://studio.plugins.atlassian.com/wiki/display/GRV/Scripted+Fields ... it's overkill though for what you're trying to do imho.

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 26, 2013

The only solution I know of is to write a pair of custom fields (derived custom fields, so nothing extra in the database), that pull their values from the parent and child separately. They'd effectively be read-only select lists. You could also do it with a single one by concatenating the cascading values, but that breaks the reporting in some ways because it flattens the cascading select (e.g. if you've got A-aaa, B-aaa, and C-bbb as your three cascading select values, then you can't report on "where second layer is aaa". You can if you have two fields)

Leave them off screens as you don't need their values repeated. I'm pretty sure the script-runner will let you do these fields without having to write a plugin.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 27, 2013

Like Jamie, I should have pointed out it's a bit of overkill to expose it as fields. I've given a technical answer without looking at the wider problem again.

I agree with Jamie - step back and look at the requirements. My fix is generalised, but if you've only got one or two specific reports/questions, then it would be better to code directly for them.

Suggest an answer

Log in or Sign up to answer