Forums

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

How to set status on issue creation with Automation?

Derek F
Contributor
January 24, 2023

My automation rules create many sub-tasks along the way, and I want them to always be created in the same status as the Story.

I have a rule that runs whenever an issue is created, which works when I manually create a sub-task but does not trigger when a rule creates a sub-task.  I would love for this to work because it write once, run many.

However,

My next attempt was to set the status (not statusCategory) on sub-task creation which I'd set for every rule that creates a sub-task with the following JSON in the More Options section (I'm very new to JSON):

{
"fields": {
"status": "Define Requirements",
}
}

It accepts the above when I publish the rule.  However, when it's triggered I get the following error in the log:

Unknown fields set during create, they may be unavailable for the project/type. Check your custom field configuration. Fields ignored -
Status (status)
I looked up that status in the REST API and it has this (URL scrubbed for privacy):
{"self":"https://blah.atlassian.net/rest/api/2/status/13718","description":"This status is managed internally by JIRA Software","iconUrl":"https://blah.atlassian.net/","name":"Define Requirements","untranslatedName":"Define Requirements","id":"13718","statusCategory":{"self":"https://blah.atlassian.net/rest/api/2/statuscategory/4","id":4,"key":"indeterminate","colorName":"yellow","name":"In Progress"}}


 

1 answer

1 accepted

2 votes
Answer accepted
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 24, 2023

You can not just set a status on an issue, it is not a field.  It is an indicator of where an issue is in the workflow.

In some types of project, the status is now offered as something you can set, but the code behind that is still effectively doing a transition.

To do this with an automation, you would need to catch "issue create", and then trigger an issue transition to the status you want it to be in.

Derek F
Contributor
January 24, 2023

Status is not in the list when I click "Choose fields to set".

 

Also I stated:

I have a rule that runs whenever an issue is created, which works when I manually create a sub-task but does not trigger when a rule creates a sub-task. 

Like Nic Brough -Adaptavist- likes this
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 24, 2023

I know, as I said, status is not a field.

You'll need to look at what the trigger is for the rule.

Derek F
Contributor
January 24, 2023

This is the rule.  Doesn't even fire when a sub-task is created by a rule.

 

subtask.PNG

Like Nic Brough -Adaptavist- likes this
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 24, 2023

Sorry I misread your first post about where the automation was.

Automations don't trigger other automation, as you could easily create an unintended cascade or even infinite recursion if you get it wrong.

Click on the "rule details" in your screenshot, and look for the "Allow rule trigger" check box. 

I'm usually very cautious with this - I save the rule, then go back into the rule details so I can quickly untick it if I need to.  Then test the rule in another window or tab!  I don't know if there is now recursion protection in there, but I did manage to take out a (server) system with an early version of automation!

Derek F
Contributor
January 25, 2023

Thanks Nic -- I had always overlooked that checkbox.  Problem solved :)

Like Nic Brough -Adaptavist- likes this
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 25, 2023

Every time I run into this one, the phrase "spectacularly obscure" springs to mind.

I'm really glad we got there in the end, but I apologise that it took so long - I should have spotted it when you said "doesn't fire"

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events