Hi Team,
My name is Matheus Fernandes, I am part of JIRA Support Team from Johnson & Johnson. I am currently working to get Script Runner configured to create default sub-tasks in automatically way. However, I am not getting it done. Look what I have done:
Following the steps above, I am not getting the expected result. Is there any thing that I am missing?
Thanks in advance!
I guess it is due to your position of the create subtask post function within the other post functions. Put it below the function "Re-index an issue to keep indexes in sync with the database"
see https://jamieechlin.atlassian.net/wiki/display/GRV/Built-In+Scripts#Built-InScripts-Createasub-task
Also check the logs, and see if there are any errors.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jamie,
On added subtask script runner postfunction.
import com.atlassian.jira.component.ComponentAccessor def customFieldManager = ComponentAccessor.getCustomFieldManager() def groupCf = customFieldManager.getCustomFieldObjectByName("Code Approving Group") def demoSelect =customFieldManager.getCustomFieldObjectByName("High Level Deployment Environments") def highlevel = demoSelect.getValue(issue) def patch =customFieldManager.getCustomFieldObjectByName("Patch Type/s") def patchType = patch.getValue(issue) def groupManager = ComponentAccessor.getGroupManager() if(issue.issueType.name=="Patch Source Core Request Sub-Task" && (highlevel.toString().contains("PROD")|| highlevel.toString().contains("BETA") || highlevel.toString().contains("DEMO") || highlevel.toString().contains("PREPROD")) && (patchType.toString().contains("Code"))){ def group = groupManager.getGroup("jira-tech-infra-cr-application-core-approvers") issue.setCustomFieldValue(groupCf, [group]) }
import com.atlassian.jira.component.ComponentAccessor def customFieldManager = ComponentAccessor.getCustomFieldManager() def groupCf = customFieldManager.getCustomFieldObjectByName("Code Approving Group") def demoSelect =customFieldManager.getCustomFieldObjectByName("High Level Deployment Environments") def highlevel = demoSelect.getValue(issue) def patch =customFieldManager.getCustomFieldObjectByName("Patch Type/s") def patchType = patch.getValue(issue) def groupManager = ComponentAccessor.getGroupManager() if(issue.issueType.name=="Patch Source Core Request Sub-Task" && (highlevel.toString().contains("PROD")|| highlevel.toString().contains("BETA") || highlevel.toString().contains("DEMO") || highlevel.toString().contains("PREPROD")) && (patchType.toString().contains("Code"))){ def group = groupManager.getGroup("jira-tech-infra-cr-application-core-approvers") issue.setCustomFieldValue(groupCf, [group]) }
I have added below to "Re-index an issue to keep indexes in sync with the database."
But is not working, any thing wrong in my code. I am not seeing any error in the logs.
But the script is working in other transitions, except On create transition.
Best Regards,
Suresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
please don't cross-post Suresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks everyone!
I created the post-function "Re-index an issue to keep indexes in sync with the database" and it worked very well.
Best Regards,
Matheus Fernandes.
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.