Parsing Custom field of type "Version Picker"

I'm pulling JIRA data into my database using a Perl script to create csv files, which are then imported to the database. While I'm able to pull in the "affectsVersions" and "fixVersions", I'm having trouble pulling in just the displayed string for a custom field of the same type, "Version Picker". (It's custom field number "10780" below).

Here's the related snippets...

sub getSingularObjectFromString($$);

print(getVersions($issue->{affectsVersions}) . $DELIM); # gets displayed contents
print(getVersions($issue->{fixVersions}) . $DELIM); # gets displayed contents
print(getSingularObjectFromString($issue, 10780) . $DELIM); # Trying to get just the "displayed" contents


...for "affects versions" and "fixVersions" I can just pull the data by using "getVersions"...

sub getVersions {

my ($versions) = @_;

my $str;

return "" if (scalar(@$versions) == 0);

foreach my $version (@$versions) {
if ($str) {
$str .= ", " . $version->{name};
} else {
$str = $version->{name};

return $str;

...but since "testVersions" is a custom field  (of the same type as the others), I'm trying to get just the displayed/rendered value that appears.


# Trying to get just the "displayed" contents of the "test version" custom field. Tried several variations here...


sub getSingularObjectFromString($$) {

my ($issue, $fieldID) = @_;

my $customFields = $issue->{customFieldValues};

return "" if (scalar(@$customFields) == 0);

foreach my $customField (@$customFields) {

if ($customField->{customfieldId} eq "customfield_$fieldID") {
return $customField->{values};

return "";


...My scripts work fine and pull a version number (such as "") for both "affectsVersions" and "fixVersions", but for the custom field it seems to be pulling a number that JIRA uses as a reference to those versions, so I get something like "23591" instead of "". Am I missing something? I've tried these methods and a few more...





All of these pull the "number" from the custom field, not the displayed value.

Is there a way to get the displayed Test Versions of "" that is displayed when the issue is viewed in JIRA? Any insight would be helpful. Thanks!


1 answer

Let me summarize with an example. I have a fixVersion that displays "" on the JIRA issue screen. I also have a Tested Version that also displays "" on that same issue. Both of these reference (internally, in JIRA) a "number". For this example that number is "23303". When I try to pull the values from these JIRA fields, I get "" for the fixVersion, but "23303" for the Tested Version. How do I get the value that is being displayed by JIRA for my custom field, instead of the number 23303?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,018 views 4 9
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