It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

So hear is our scenario:

We would like to connect our JIRA to TFS and sync the Work Items accross both platforms. We have set up the TFS4JIRA synchronizer. In order for our items to sync properly, we need to have a Region and Country field.

The problem is that our regions (North America, Asia, Europe, etc.) define the country list. The built in cascade list would work perfectly for us if we did not have to export that field out to our TFS server. The problem being that the cascade list appears to store both values of the lists (Region/Country) in the single field, while our requirement is that they are seperate.


Region (selected) -> North America --- Custom Field 1

Country (selected from North America) -> United States --- Custom Field 2

Is there anything out there that we can do? Or a script we could write?

Edit: a possible scenario that we though of is using the plugin ScriptRunner to creat two addtional custom fields and getting the values for those fields from the cascaded list. Any ideas on how to get the values selected from the cascaded list?

1 answer

1 accepted

0 votes
Answer accepted

Update: I went ahead and created a regular cascaded list named "Region/Country", where country list dependened on region.

I then used the plugin ScriptRunner's scripted custom fields. One was "Region" and the other was "Country", from there I wrote a groovy script to extract the data from our original custom field. Here is our script:

import com.atlassian.jira.ComponentManager
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager

//Get our field
def componentManager = ComponentManager.getInstance().getCustomFieldManager()
def cascadedList = componentManager.getCustomFieldObject( "customfield_10213" )
def cascadedValue = cascadedList.getValue( issue ) 

//Make sure we have a list
if ( cascadedList != null )
	//Get the region/country pair and tokenize the string
	pair = cascadedValue.toString()
	def tokens = pair.tokenize( ":" )
    //Always will be 3rd index (verify?)
    country = tokens.getAt( 3 )
	country = country.minus( "]" )
	return country
	return "Error sending country information..."

It was easy to change it for the region case. I am happy with this solution.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Next-gen

Keyboard shortcuts have arrived for next-gen projects!

...ollected feedback from users around the lack of shortcuts, and we’re here to address that: In next-gen projects, I miss the keyboard shortcuts badly. This is particularly true on the Board, but also i...

221 views 2 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you