Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to read all the values of "Fix Version/s" field of an issue in a project using Groovy script?

Ramaswamy Parameswaran
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 30, 2018

I need to read all the values of "Fix Version/s" field and need to compare those values matches with the text "Released" or not.

 

I tried with linkedIssue.fixVersions*.name.contains("Released") but it's not working out.

 

Any help would be great and helpful. Thanks in advance.

 

Regards,

Ramaswamy

1 answer

0 votes
Daniel Yelamos [Adaptavist]
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.
May 30, 2018

Hi Ramaswamy:

If, and only if issue is an instance of MutableIssue, or Issue:


issue.getFixVersions().find {it.name == ["fixVersion.1.0"]}

In your case, "released" would do the trick.

The main problem is that I believe that your linkedIssue might be an IssueLink, not an actual issue.

If you want, you can debug your code in parts, like this: 

log.debug(issue.getFixedVersions().collect {it.name})

 This line would print all of the getFixedVersions within your issue, just to check that there's actual fixed versions in your issue.

Do say if I can help you further.

Cheers!

DYelamos

Ramaswamy Parameswaran
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 31, 2018

Hi DYelamos,

Thank you for the response, but as you said I could able to get the Issue's Fix Version/s value, but not the IssueLink. And also for the log, it's same.

Any help would be appreciated.

Thanks,

Ramaswamy

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events