test = parentIssue.getCustomFieldValue(customFieldManager.getCustomFieldObject("customfield_10300")) // test == class java.util.HashMap (Cascading Select custom field) issueSubTaskParams.addCustomFieldValue(10300, test)
addCustomFieldValue accepts `String` only
So, how to get proper String value from HashMap?
i use the following
//Gets a reference to the desired custom field - Cascading Select List
CustomField customField_object = customFieldManager.getCustomFieldObject( customfied_id );
//get the original value in a map Map valueMap = (Map)issue.getCustomFieldValue(customField_object); Option option = (Option)valueMap.get(null); String firstLevelValue = option.getValue(); option = (Option)valueMap.get("1"); String secondLevelValue = option.getValue();
//Create a string value with the values you get from Cascade select lis
String value = firstLevelValue + " - " + secondLevelValue
You can then pass the value string to your desired custom field.
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.Read more
Atlas Camp is our developer event which will take place in Barcelona, Spain from the 6th -7th of September . This is a great opportunity to meet other developers and get n...
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!
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