Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Can I calculate a project value in Automation for JIRA?

Stanislaw Juzwicki
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 27, 2019

Hi,

 

I am fiddling a bit with Automation for JIRA and I have a use case I can't seem to find the right solution for.

 

Use case: I have a custom field on my issue (drop-down list) and I want to create a new issue whenever this value is changed. Trick is that depending on the new value, I would like to create this new issue in different projects (of course I do have the custom field values mapped to appropriate projects). So whenever let's say someone edits an issue and selects custom field value "AAA", I want to create a new issue in project with a key "AAA" and so on.

 

Challenge - when I am building an automation rule and adding a "create issue" component, I can only select "Same project", "Same as trigger" or a specific project - I cannot calculate a value. Can I set any project and then manipulate it in "Additional fields"?

Is there a way around this?

 

PS - for now I have 5-6 values of the custom field, so worst case I can simply do if / else-if and for that amount it will work, but when I get to 20-30 values, it will get... cumbersome :)

1 answer

1 vote
Mirek
Community Champion
May 27, 2019

Hi @Stanislaw Juzwicki ,

Congratulation on creating your first post! :)

Looking at what you want to achieve and which tools are using I think it should be possible. Did you tried maybe using Advanced fields?

https://docs.automationforjira.com/working-with-issue-data/advanced-fields.html#when-to-use

You should be able to generate a specific JSON request that would create an issue in different project based on REST API url. You should just inject the values from the custom fields to the JSON. It should be dynamic (depends on what values are you using in your custom fields of course) when using smart values feature.

https://docs.automationforjira.com/working-with-issue-data/smart-values.html#format

Stanislaw Juzwicki
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 27, 2019

Hi Mirek,

No, I have not tried advanced fields yet - that was my next idea, but from my previous tests with advanced fields (in different scenarios) I noticed that the issues were created with the values from the main rule definition first and then overwritten when the rule parsed the JSON request. So I was a bit afraid that in this case it would first create the issue in one project and then when the rule comes to the advanced fields JSON it would somehow create it again in another project.

Anyway - I will check that way next :)

Like Mirek likes this

Suggest an answer

Log in or Sign up to answer