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.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.