Forums

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

Convert DocumentIssueImpl to Issue

Marzi Goodarzian
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 3, 2023

Hi

I write a code and want add “collection of issues from jql “ to a “Issue Picker Field”, search return

SearchedIssue = DocumentIssueImpl[issueKey=TEST-xxx]

and can not add this to Issue Picker Field

How to fix it?

Part of my code:

ArrayList<Issue> fixVersionIssueList = new ArrayList<Issue>();

fixVersionIssueList.add( SearchedIssue as Issue ); 
issue.setCustomFieldValue(VersionIssueCollection,fixVersionIssueList);

VersionIssueCollection is my issue picker field.

and log:

fixVersionIssueList= [DocumentIssueImpl[issueKey=TEST-xxx],DocumentIssueImpl[issueKey=TEST-zzz]]

How conver DocumentIssueImpl to Issue ?

thanks

1 answer

0 votes
Marzi Goodarzian
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 3, 2023

It resolved.

solution:

Convert DocumentIssueImpl to Issue by:

IssueManager issueManager = ComponentAccessor.getIssueManager()
MutableIssue mutableIssue = issueManager.getIssueObject(SearchedIssue.id)
and then update Issue:
issueManager.updateIssue(ApplicationUser,issue,EventDispatchOption.ISSUE_UPDATED,false)

Suggest an answer

Log in or Sign up to answer