I'm trying to create projects using Jelly and i need to associate these projects with a particular workflow Scheme.
I need help for using ComponentManager to make the association.
Thanks a lot
Community moderators have prevented the ability to post new answers.
Thanks for the answer but it's not helping
I need how to make a link between a project and the Scheme
When i use <core:invoke on="${workflowSchemeManager}" method="addSchemeToProject">
i get : No such accessible method: addSchemeToProject() on object: com.atlassian.jira.workflow.DefaultWorkflowSchemeManager
any idea ?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is a working Jelly script that assigns workflow scheme myScheme to project with key MYPROJECT
<JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.enterprise.JiraTagLib" xmlns:core="jelly:core" xmlns:log="jelly:log"> <!-- Grab managers. Do it using ComponentAccessor now which gives better compatibility in Jira 5! r --> <core:invokeStatic className="com.atlassian.jira.component.ComponentAccessor" method="getWorkflowSchemeManager" var="workflowSchemeManager"/> <core:invokeStatic className="com.atlassian.jira.component.ComponentAccessor" method="getProjectManager" var="projectManager"/> <!-- Get the project with key "MYPROJECT" using ProjectManager --> <core:invoke on="${projectManager}" method="getProjectObjByKey" var="project"> <core:arg type="java.lang.String" value="MYPROJECT"/> </core:invoke> <log:warn>Project ${project} found</log:warn> <!-- Get the workflow scheme "myScheme" --> <core:invoke on="${workflowSchemeManager}" method="getSchemeObject" var="scheme"> <core:arg type="java.lang.String" value="myScheme"/> </core:invoke> <log:warn>Scheme ${scheme} found</log:warn> <!-- Assign scheme to project --> <core:invoke on="${workflowSchemeManager}" method="addSchemeToProject" > <core:arg value="${project}"/> <core:arg value="${scheme}" /> </core:invoke> </JiraJelly>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a lot
looks like i was using the wrong accessors. Its's working fine
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You're project key has to be UPERCASE, if not, the Project object will not be found, and the Method addSchemeToProject works only with a project object valid !!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried like in the first answer, but i only get an exception.
we are using jira 5.1.8
<!-- Erstellt Projektpools @author stnieder --> <JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.enterprise.JiraTagLib" xmlns:sql="jelly:sql" xmlns:core="jelly:core" xmlns:log="jelly:log"> <log:info>START :: SEP_JIRA_CreateProject-unit-jelly.xml | $Rev$ | $Author$ | $Date$</log:info> <core:set var="jiraUser" value="xxxx" /> <core:set var="jiraPassword" value="xxxx" /> <core:set var="projectKey" value="Test" /> <core:set var="projectName" value="Test Pool von Jellys erstellt" /> <core:set var="projectLeader" value="stnieder" /> <core:set var="projectWorkflowScheme" value="15200" /> <jira:Login username="${jiraUser}" password="${jiraPassword}"> <!-- Projektpool erstellen <jira:CreateProject key="${projectKey}" name="${projectName}" lead="${projectLeader}"> </jira:CreateProject> --> <!-- Workflow-Schema zuweisen --> <!-- Grab managers. Do it using ComponentAccessor now which gives better compatibility in Jira 5! r --> <core:invokeStatic className="com.atlassian.jira.component.ComponentAccessor" method="getWorkflowSchemeManager" var="workflowSchemeManager"/> <core:invokeStatic className="com.atlassian.jira.component.ComponentAccessor" method="getProjectManager" var="projectManager"/> <!-- Get the project with key "MYPROJECT" using ProjectManager --> <core:invoke on="${projectManager}" method="getProjectObjByKey" var="project"> <core:arg type="java.lang.String" value="${projectKey}"/> </core:invoke> Project ${project} found <!-- Get the workflow scheme "myScheme" --> <core:invoke on="${workflowSchemeManager}" method="getSchemeObject" var="scheme"> <core:arg type="java.lang.String" value="15200"/> </core:invoke> Scheme ${scheme} found <!-- Assign scheme to project --> <core:invoke on="${workflowSchemeManager}" method="addSchemeToProject" > <core:arg value="${project}"/> <core:arg value="${scheme}" /> </core:invoke> </jira:Login> <log:info>STOP :: SEP_JIRA_CreateProject-unit-jelly.xml</log:info> </JiraJelly>
Skript konnte nicht ausgeführt werden.
Extra Information: [hide]
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.