Getting an error : the variable [issue] is undeclared
I am using this in a Post Function of a workflow
Server 8.3.2 with ScriptRunner 5.6.6.1-jira8
import com.atlassian.jira.component.pico.ComponentManager
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.MutableIssue;
import com.atlassian.jira.bc.issue.IssueService;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.IssueManager;
def projectName = issue.project.name;
I believe that the console is just a java interpreter and is not "aware" that the issue object will be defined at execution time. That is why it is showing a warning that it is not declared. Also your code is fine, it works in groovy (which is meant to have more simple syntax).
It would be better something like issue.getProjectObject().getName() but your code should work. I don't see an error, and I have just put your code in a postfunction and it works. Nevertheless I have experienced some kind of hangs with scriptrunner script console from time to time, so I would try to log out and log back in, closing the browser and even clearing the browser's cache.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
String org1_val = issue.getCustomFieldValue(cf_org1) I have the same error but was unable to solve the issue. any leads @Juan Ramón Alonso @Jon Kocen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
it would be nice if the scriptrunner editor know's the standard injected variables.
Then the script colud show as valid
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.