Hi Jamie,
we have 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]) }
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
Make it the first post-function, if it's after "reindex..." it's too late.
script_postfnct.PNGI am sorry jamie, I will keep in mind there won't be a cross questions from next time.
I am unable to add comment in my original request,due to my other account doesn't have the eligible points.I will this account from next time onwards.
Thank you for understanding.
Please see my order of the scriptost function, but still not able set the group after the sub-task create transition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Make it the first post-function...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Don't use this:
def highlevel = demoSelect.getValue(issue)
use issue.getCustomFieldValue(demoSelect)
same for the others.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jamie,
Just to test we have added following simple script set the group.But, we are unable to set the group to the field in JIRA subtask post function.
import com.atlassian.jira.component.ComponentAccessor def customFieldManager = ComponentAccessor.getCustomFieldManager() def groupCf = customFieldManager.getCustomFieldObjectByName("Code Approving Group") def groupManager = ComponentAccessor.getGroupManager() def group = groupManager.getGroup("jira-tech-infra-cr-application-core-approvers") issue.setCustomFieldValue(groupCf, [group])
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
unreadable code, it's all on one line... please make it easier for people to help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please find now.
import com.atlassian.jira.component.ComponentAccessor def customFieldManager = ComponentAccessor.getCustomFieldManager() def groupCf = customFieldManager.getCustomFieldObjectByName("Code Approving Group") def groupManager = ComponentAccessor.getGroupManager() def group = groupManager.getGroup("jira-tech-infra-cr-application-core-approvers") issue.setCustomFieldValue(groupCf, [group])
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is it a multi-group picker? If it's a single picker remove the square brackets around group. Can you check your log files too.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is multi-group picker only.I have already enabled script logs.
This script is working fine in other transitions,It is not working only when create sub-task issue transition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.