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

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 Join to answer
Community showcase
Jason Wong
Published Tuesday in Agility Beta

Welcome to agility

Every team in the world is unique, and so   Atlassian believes   that each and every team's best way of working  needs to  be molded to their unique circumstances  – ...

454 views 7 16
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot