Behaviors setFieldOptions on issueLinks-issues

Robin Fahy March 13, 2018

I am trying to use a behavior to limit the available "Issue" options on the system issue links field

FormField issueLinkItems = getFieldById('issuelinks-issues')

String allowedLinkedItemsJql = "type = Bug"

//JiraHelper is a function I created that returns a SearchResult based on jql
//OPTION A: Set options based on the "Issue" interface
List<Issue> allowedLinkedItems = JiraHelper.findSearchResults(allowedLinkedItemsJql).getIssues()
issueLinkItems.setFieldOptions(allowedLinkedItems)

//OPTION B: Set options based on the issue key (as in, BUG-1234)
List<String> allowedLinkedItemsKeys = allowedLinkedItems.collect{it -> it.getKey()}
issueLinkItems.setFieldOptions(allowedLinkedItemsKeys)

Logs are spitting out errors:
A: Unsupported type class com.atlassian.jira.issue.DocumentIssueImpl in setFieldOptions()

B: Unsupported type class java.lang.String in setFieldOptions()

meaning, I'm not entering the right type of iterable into the setFieldOptions() form for this particular field. 

 

Is there any way to do this using behaviors?

1 answer

0 votes
Prashant Mali
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.
October 14, 2018

Any update on this?

Prashant Mali
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.
October 15, 2018

I am also facing issue. any luck on the same?

Suggest an answer

Log in or Sign up to answer