Hello I have this script it was always working until I upgraded to the latest version...
on ;
MutableIssue issue = issue; it says';
the variable issue is undeclared
----------->
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.MutableIssue;
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager();
CustomField unitInCharge = customFieldManager.getCustomFieldObjectByName("Unit in Charge");
MutableIssue issue = issue;
String unit = issue.getCustomFieldValue(unitInCharge).toString();
final String PLANT_MANAGER = "user.name";
final String LOGISTICS = "user.name";
final String PRODUCTION = "user.name";
final String HSEQ = "user.name";
final String MAINTENANCE = "user.name";
final String PROCESS_ENGINEERING = "user.name";
final String PROJECT_ENGINEERING = "user.name";
final String LABORATORY = "user.name";
final String HUMAN_RESOURCES = "user.name";
switch(unit) {
case "Plant Manager":
issue.setAssigneeId(PLANT_MANAGER);
break;
case "Logistics":
issue.setAssigneeId(LOGISTICS);
break;
case "Production":
issue.setAssigneeId(PRODUCTION);
break;
case "HSEQ":
issue.setAssigneeId(HSEQ);
break;
case "Maintenance":
issue.setAssigneeId(MAINTENANCE);
break;
case "Process Engineering":
issue.setAssigneeId(PROCESS_ENGINEERING);
break;
case "Project Engineering":
issue.setAssigneeId(PROJECT_ENGINEERING);
break;
case "Laboratory":
issue.setAssigneeId(LABORATORY);
break;
case "Human Resources":
issue.setAssigneeId(HUMAN_RESOURCES);
break;
default:
break;
}
issue.store();
Hi @Derek
Did you read the latest documentation from Adaptavist? They probably have change something, and that;s why your code stop working.
Online 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.