Forums

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

Migration to JIRA 5.0, using instead GenericValue

Vitalii Onufryk April 3, 2012

mutableIssue.getGenericValue is deprecated in 5.0, but what should I use instead?

For example:

GenericValue changedIssue = updatedIssue.getGenericValue();

IssueUpdateBean issueUpdateBean = new IssueUpdateBean(changedIssue, originalIssue, EventType.ISSUE_UPDATED_ID, currentUser);

AND

updatedIssue.store();

Thanks!

3 answers

1 vote
RambanamP
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.
April 3, 2012

no need to use the generic issue use the following constructer to instanciate IssueUpdateBean class

IssueUpdateBean(Issue changedIssue, Issue originalIssue, Long eventTypeId,com.atlassian.crowd.embedded.api.User user)

Cheers,

Rambanam

Jobin Kuruvilla [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.
April 3, 2012

A MutableIssue is an Issue!

Vitalii Onufryk April 3, 2012

Cool, it works:)

Can you tell me how to get Issue from MutableIssue object? 'cause I have all methods with MutableIssue arguments..

Vitalii Onufryk April 3, 2012

Yeah, got it, thanx

But how can I make store() for MutableIssue? (The method store() from the type OfBizValueWrapper is deprecated)

mutableIssue.store();

Jobin Kuruvilla [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.
April 3, 2012

You should use IssueService to update an issue instead of using the store method.

http://docs.atlassian.com/jira/latest/com/atlassian/jira/bc/issue/IssueService.html

0 votes
RambanamP
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.
April 4, 2012

if you want to update issue use the following method

issueManager.updateIssue(authenticationContext.getLoggedInUser(),mutIssue,EventDispatchOption.ISSUE_UPDATED,Boolean.FALSE);

if you want to set current workflow step to issue use mutableIssue.setWorkflowId(Long workflowId)
and use update method to update issue
0 votes
Nic Brough -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.
April 3, 2012

Depends on what you're trying to do to the issue...

Vitalii Onufryk April 3, 2012

For example adding the comment to the issue.

I thought its not important. I mean - if the getGenericValue is deprecated, so I have to:

1) use some method for getting genericValue, that is not deprecated (but I can't find such method)

OR

2) find methods that I want to use with this issue, but those who will not use the GenericValue as an argument.

For ex.: issueUpdateBean(...), PluginUtils.updateIssue(GenericValue, Issue, String), PluginUtils.setCurrentWorkflowStep(GenericValue, String, String), and so on).

Can you help me with those methods please?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events