Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,557,708
Community Members
 
Community Events
184
Community Groups

Since release 8.x, JiraUtils.loadComponent(WorkflowTransitionUtilImpl.class) is deprecated.

Hi,

Since release 8.x, JiraUtils.loadComponent(WorkflowTransitionUtilImpl.class) is deprecated. It is giving warning.

Can u please suggest what should I use.

 

Thanks & Regards,

Pratiksha.

1 answer

0 votes
Aleksandr Zuevich
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.
Dec 16, 2019

Hi,

Why do you need WorkflowTransitionUtil? Could you share your code, please?

Hi,

to make the transition through post function I need it.

 

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.search.SearchProvider
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.workflow.WorkflowTransitionUtil
import com.atlassian.jira.util.JiraUtils
import com.atlassian.jira.workflow.WorkflowTransitionUtilImpl
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.bc.issue.search.SearchService
import com.atlassian.jira.jql.parser.JqlQueryParser
import com.atlassian.jira.web.bean.PagerFilter
import com.atlassian.jira.issue.Issue
import org.apache.log4j.Category
import com.atlassian.jira.bc.issue.IssueService


def Category log = Category.getInstance("com.PostFunction.PostFunction_BSS_MoveAOPProjectToArchitectureWhenFeatureArchitecture”.groovy")
log.setLevel(org.apache.log4j.Level.INFO)

IssueManager issueManager = ComponentAccessor.getIssueManager()
def userManager=ComponentAccessor.getUserManager()
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();
MutableIssue AOPissue
//MutableIssue issue = issueManager.getIssueObject("DE-49333")
def count = 0
def IssueLinkManager = ComponentAccessor.getIssueLinkManager()
IssueService issueService = ComponentAccessor.getIssueService()
IssueLinkManager.getInwardLinks(issue.getId()).each{ issueLink ->
if(issueLink.issueLinkType.name =="Project-Feature Link")
{
AOPissue = issueLink.getSourceObject() as MutableIssue
log.error(AOPissue)
count++
}
}
if((count == 1) && (AOPissue.issueType.getName() == "AOP Project"))
{
if (AOPissue.getProjectObject()?.getProjectCategory()?.getName()=='BSS')
{
def jqlQueryParser = ComponentAccessor.getComponent(JqlQueryParser)
def searchService = ComponentAccessor.getComponent(SearchService)
def query = jqlQueryParser.parseQuery('issuekey = "'+ AOPissue.key +'" AND status was in ("Architecture")')
def results = searchService.search( currentUser, query,PagerFilter.getUnlimitedFilter())
if(results.total == 0)
{
WorkflowTransitionUtil workflowTransitionUtil = (WorkflowTransitionUtil) JiraUtils.loadComponent(WorkflowTransitionUtilImpl.class);
workflowTransitionUtil.setIssue(AOPissue as MutableIssue);
workflowTransitionUtil.setUserkey(currentUser.key);
workflowTransitionUtil.setAction(171);
workflowTransitionUtil.validate();
log.error("Validated")
workflowTransitionUtil.progress();
log.error("Success")
}
}
}

 

Thanks & Regards,

Pratiksha.

Aleksandr Zuevich
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.
Dec 16, 2019

You have to rewrite your WorkflowTransitionUtil part to use TransitionOptions and IssueService like it's described here.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events