Hello Team,
How to transition the workflow from create to following statuses directly when conditions are matched. Could you suggest me how to achieve this. There is any script runner code to execute this ?
- Function to update status to COMPLETED - MONITORING. New RT subtasks should be updated to this status when Solution Type = System Automation and Synopsis = Successful Testing
- Function to update status to COMPLETED - NO TESTING. New RT subtasks should be updated to this status when Solution Type = Not Found or Fulfillment and Synopsis = Only FEDS Data or No Recent Data
I tried with this code also, but getting same error on creating page.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.IssueImpl
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.project.ProjectManager
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
boolean status = false
IssueManager issueManager = ComponentAccessor.getIssueManager()
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()
CustomField myCustomField = customFieldManager.getCustomFieldObjectByName("Solution Type")
CustomField myCustomField1 = customFieldManager.getCustomFieldObjectByName("Synopsiss")
String myCustomFieldVal = (String) issue.getCustomFieldValue(myCustomField)
String myCustomFieldVal1 = (String) issue.getCustomFieldValue(myCustomField1)
if (myCustomFieldVal.equals("System Automation") && myCustomFieldVal1.equals("Successful Testing"))
{
status = true
}
return status