Using Groovy for the first time through JMWE
Setting up a post function that will create a new issue and assign it to a Project using a custom field (Single Select List) value.
Tried:
x = issue.get("customfield_1000")
issue.setProjectObject(x)
Also tried:
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def customField = customFieldManager.getCustomFieldObjectByName("Project")
def newValue = issue.getCustomFieldValue(customfield)
issue.setProject(newValue)
All with no luck. Thanks for the help in advance !
Logged a ticket with the @Appfire Support team who answered the question. Thought i'd repost the answer to let others know !
In JMWE you could use the “Calculated” project option on the Create/Clone Issue(s) post-function. Please refer to the example below:
In the example above, the custom field type is a project picker. Then you can decide what will trigger the post-function hence the issue copy/clone.
For example, you could use Event Based Actions to execute the post-function once a specific issue field value is changed or when the issue itself is transitioned.
Hi @Zac Boyd
Welcome to the community!
If I understand you correctly, you want to create the issue dynamically in another project say ABC based on the selection of custom field value in project XYZ.
Did you try considering doing this using automation rules?
Thanks,
Vamsi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes i have,
As a work around we have a manual trigger set up to link to one Project, but we have over 15 projects currently and trying to create a way to set it based off the field doesn't work in Automations.
Tried:
Trigger= When Value changes for Field X
Action= Then Create a New issue,
Project = "Same project as trigger" ( This is then run as the project the automation runs from)
I have found no better options to select a custom field dynamically in automation
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Zac Boyd
Automation rules are generally specific to the related projects only.
If you want to create an issue in Project XYZ after an issue is created in Project ABC, you are accessing multiple projects. So, you will have to create the automation rule in the global level. That way, you will have option to select the specific project that you want.
Note that, the owner of the automation rule should have related permissions in all the affected projects.
Hope this helps.
Thanks,
Vamsi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, i should've been a bit more clear, the above is at the Global level.
I cannot set the Action to choose a dynamic field. You can only either state a specific project or "current project" or "trigger project"
The reason i want to set it as dynamic is that we are expecting a large influx of Projects to be created so i want to avoid creating a Multiple automations each time a Project is created.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Zac Boyd
Understood.
I have checked different things and did not work for me either. I am not completely sure whether it is possible using post functions.
Please check with Atlassian support if you have not already contacted them. And please update here if you are able to find the solution.
Thanks,
Vamsi
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.