You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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.
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 must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You have to rewrite your WorkflowTransitionUtil part to use TransitionOptions and IssueService like it's described here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.