Hi,
I am using JIRA version 7.2.9 and Script Runner version 5.0.4.
I want to set the Security Level for the current issue object in Behaviour. But I am not able to get the current issue object.
Can someone please help ?
In actual script you can use 'issue' for current issue object.
For testing in script console you can use following,
import com.atlassian.jira.component.ComponentAccessor
def issueManager = ComponentAccessor.getIssueManager()
def issue = issueManager.getIssueObject("ABC-123")
I have already tried using "issue" object, but it is giving me the error 'the variable [issue] is undeclared'.
Please refer the logs attached.
That suggests that you have not used the last line of Suhas's code to get the issue.
I wan't to get current issue in Behaviour, in this case I will directly use 'issue' for current issue object (as depicted in screenshot below). Am I right ?
In behaviours you can either use the underlyingIssue variable or getIssueContext()
As @Kabelo Mokgoro suggests, underlyingIssue is correct for a Behavior server-side script.
issueContext is not of type issue.
For example:def wf = workflowManager.getWorkflow(underlyingIssue)
i have same problem
my code is
import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.issue.MutableIssue;
def customFieldManager = ComponentAccessor.getCustomFieldManager()def textCf = customFieldManager.getCustomFieldObjectByName("Client")String clientName = underlyingIssue .getCustomFieldValue(textCf)
but i get error "the variable underlyingIssue is undeclared."
i have tried with issue. and then get error "the variable issueis undeclared."
so can you help me pls.
@ragif.ahmadov to get the field value you can directly use like this -
String clientName = getFieldByName("Client").getValue()
no need for IssueContext. Just make sure the field should be present on the form/pop-screen
This helped, thanks @Alexey Matveev
It looks like you're new here. Sign in or register to get started.