Automation - Project Picker for Create Issue Action

Stephen Wright _Elabor8_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 3, 2021

Hi All,

I'm trying to create an Automation rule, which looks like the following:

  • Trigger: When Issue transitioned to Done
  • Action: Then create an Issue in a target Project

For the field Project in the Action I'd like to set this dynamically, and have a Project Picker (single project) custom field where users can choose any Project from across the instance.

The Actor in the Automation rule is a Jira Admin, and has Create Issues permissions in all Projects.

I've tried various different smart values to allow this dynamic setting of Project - including...

  • {{issue.customfield_123456}}
  • {{issue.customfield_123456.pid}}
  • {{issue.customfield_123456.name}}
  • {{issue.customfield_123456.key}}

...but all of them error.

Is there another way this can be achieved, either using a smart value, an advanced option or an alternative?

Thanks!

2 answers

1 accepted

6 votes
Answer accepted
John
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 6, 2021

Hi @Stephen Wright _Elabor8_ 

We currently don't support smart values in our project and issue type fields. We have an open issue to track this: https://codebarrel.atlassian.net/browse/AUT-948

As noted on this community post you could set the project in the "more options" on the issue create action. But you will have to do some testing, I think this will only work if the issue/project type/fields are the same between the projects. 

{
"fields": {
"project": {
"key": "{{issue.CF Project Picker.key}}"
}
}
}

Hope that helps

- John

Thierry BLOCH May 30, 2022

Hello,

This is working for me, thank you. 

Timo Fitzner April 24, 2023

Hey, 

i cannot get this automation to work.

I tried everything in this thread. For me, the more options function does not work with this code. It creates issues in the same project and ignores the more options code. So it seems. 

Is there something i need to have an eye on or is it possible to use smart values in the project field now and do i need to have same project as option?

Amos November 1, 2023

Works for me (using 9.4.X / 5.4.X LTS).

0 votes
Fabian Lim
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 3, 2021

Hi @Stephen Wright _Elabor8_

I would go with the alternative way using groovy script or sil script and create it though a post-function which I know it will work.

You need to first grab the project key from the customfield and then create the issue to that project and the corresponding fields.

Let me know if you are interested and I can provide more details.  

Hopefully someone can figure it out using jira automation.

Stephen Wright _Elabor8_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 3, 2021

Hi @Fabian Lim 

Open to using a post-function / Scriptrunner, if that's the best option.

It'd be good to get some more details of how you might do this, to work from!

Ste

Suggest an answer

Log in or Sign up to answer