Hello,
I need to get a Workflow scheme for a current project, but trying to run code:
import com.atlassian.jira.component.ComponentAccessor
def SchemeID = ComponentAccessor.getWorkflowSchemeManager().getWorkflowScheme(issue.getProject()).get("id")
gives nothing.
JIRA v6.2.4
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I see.
Does your issue.getProject() return a value. Put log.error(issue.getProject) and have a look.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
groovy.lang.MissingPropertyException: No such property: getProject for class: com.atlassian.jira.issue.IssueImpl
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try this code
import com.atlassian.jira.component.ComponentAccessor
def SchemeID = ComponentAccessor.getWorkflowSchemeManager().getWorkflowSchemeObj(issue.getProjectObject()).getId()
log.error(SchemeID)
It works for me
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, it does! Thank you for your help! :)
Been trying "issue.getProjectObject()" (as it is and also fetching key, name, id) since yesterday when I saw that "issue.getProject" is deprecated, but couldn't get anything and I don't know why.
But today logs show me normal output for
log.error(SchemeID)
and also for
log.error(ComponentAccessor.getWorkflowSchemeManager().getWorkflowSchemeObj(issue.getProjectObject()).getId())
...yesterday I've been trying only the last one.
Once Again - Thank you! :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To get Workflow Scheme ID in Behaviuors
import com.atlassian.jira.component.ComponentAccessor
def ProjectObj = getIssueContext().projectObject
def SchemeID = ComponentAccessor.getWorkflowSchemeManager().getWorkflowSchemeObj(ProjectObj).getId()
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.
Dear Aleksandr,
When you edit a Workflow Scheme, you will see its ID in the URL.
Friendly Regards,
Jeremy Mooiman
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.