Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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.

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
Community showcase
Published in Apps & Integrations

Send an Email or Publish to Confluence - What should you do with your release notes?

Background When you hear the words ‘Release notes’, almost always you think of an unsolicited email from a software vendor. But I am here to tell you that from our data, sending release notes via E...

112 views 1 2
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you