Automation: Issue fields condition for issue type does not work
Asked by Glenn Ruysschaert:

Helllo,

I have a trigger "When: issue transitioned".

I want to check if the parent is an epic, and if so continue with my flow.

This is what that part of my branch looks like:

![Screenshot 2024-06-28 at 07.51.09.png](/t5/image/serverpage/image-id/332302i756E8F9C0CA57A18/image-size/large?v=v2&px=999 "Screenshot 2024-06-28 at 07.51.09.png")

But when the rule gets triggered by a child with an epic, the step fails, even though in the logs I can see the issue type is an epic.

![Screenshot 2024-06-28 at 07.51.25.png](/t5/image/serverpage/image-id/332303i026CB5A3778886E1/image-size/large?v=v2&px=999 "Screenshot 2024-06-28 at 07.51.25.png")

The log "Is epic' does not show up.

What am I doing wrong here?

Kind regards


Answers:
author: John Funk
body: Hi Glenn,

First, not sure why that does not work. But, maybe you can work around it by adding a Condition right after the Projects condition to check for the Issue Types that would have Epic as a parent. Also, if you create the rule to be a Multiple projects rule and select those projects in the Rule Details, you shouldn't have to do a Condition here to check the Projects.

Or the other thing is perhaps the Epic is not in one of the Projects you listed above?


author: Trudy Claspill
body: Hello [@Glenn Ruysschaert](/t5/user/viewprofilepage/user-id/4054693)

What is the project type of the project that contains the Epic? Get that information from the Type column on the View All Projects page under the Projects menu.

Is this rule scoped to a single project, or multiple projects?

Was this rule created by copying another rule or have you changed the project(s) in scope since setting up the condition to check if the parent issue is an Epic? You need to select the project(s) in scope before setting up a condition that will check issue type, especially if the project in scope is a Team Managed project. The Issue Types in Team Managed projects are unique, even when they have the same name as another issue type defined globally or in another Team Managed project. If you changed the project in scope and did no update the condition to reselect the Epic value, then the condition may fail due to being compared to a different Epic issue type that has a different unique numeric identifier in the database.

comments: author: Glenn Ruysschaert
body: Hello [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011) ,

There are multiple projects, they are all "Company-managed software".

![Screenshot 2024-06-28 at 08.58.04.png](https://community.atlassian.com/t5/image/serverpage/image-id/332315i3606FEF166EDA1E7/image-size/large?v=v2&px=999 "Screenshot 2024-06-28 at 08.58.04.png")

The rule was new.

I tried deleting and creating a new "Issue Type equals" step, but this had no effect.

Kind regards


author: Trudy Claspill
body: What do you have in the Rule Details page for project scope?


author: Glenn Ruysschaert
body: Hello [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011) ,

![Screenshot 2024-06-28 at 15.59.12.png](https://community.atlassian.com/t5/image/serverpage/image-id/332405i445B5C62319EFF48/image-size/large?v=v2&px=999 "Screenshot 2024-06-28 at 15.59.12.png")


author: Trudy Claspill
body: This is puzzling. I have not been able to recreate this problem in my own system, creating the same type of rule that has multiple Company Managed projects in scope.

Can you confirm that you don't have a second field named "Issue Type"? Jira does not require that custom fields have unique names. It is possible that somebody has created a custom field that reused the "Issue Type" name.


author: Trudy Claspill
body: Hello [@Glenn Ruysschaert](/t5/user/viewprofilepage/user-id/4054693)

You said you checked the issue types. I was not asking you to check the issue types. I was asking you to check the Custom Fields to find out if there is a custom field named "Issue Type".

https://\<yourURL\>/secure/admin/ViewCustomFields.jspa

There should not be a field on that page named "Issue Type". If there is, that is the root of your problem.

You can also try using a Smart Value condition rather than an Issue Field condition, and comparing the {{issue.type.name}} to "Epic", as a workaround.


author: Glenn Ruysschaert
body: [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011)

Ah, my bad, I misread what you said.

There is no custom field with that name.

![Screenshot 2024-07-01 at 09.20.18.png](https://community.atlassian.com/t5/image/serverpage/image-id/332685iC36C0191D3B314B7/image-size/large?v=v2&px=999 "Screenshot 2024-07-01 at 09.20.18.png")

I tried with a Smart Value, and that seems to work.

However, the original automation is not only for Epics but also Initiatives.  
That's why I used the Issue Type, because you can say "one of" (Epic or Initiative).

With Smart Values, I don't know how to do an "or".  
Unless I duplicate the branches (for epic and initiative), which is less great for maintenance.


author: Trudy Claspill
body: You could try a JQL condition (ignore the Trigger in my example)

![Screenshot 2024-07-01 at 12.32.16?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/332686i9848520C02321BE6/image-size/large?v=v2&px=999 "Screenshot 2024-07-01 at 12.32.16?AM.png")


author: Glenn Ruysschaert
body: [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011)

Yes, that worked!

It works in the simplified automation and the full automation, when I replace the built in "Issue Type" check with your JQL condition.

Thank you very much!


author: Trudy Claspill
body: You're welcome!

If my responses helped you solve your problem, please consider clicking the Accept Answer button for my answer.

I am still puzzled as to why the Issue Field condition didn't work. That is so strange!


author: Glenn Ruysschaert
body: [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011)

Hello,

I checked the issue types, there is only one of each.

I recreated a very basic setup (this time with only one target project), and it still does not work.

The epic and story I am testing with is this, I am changing any of the story statuses:

![Screenshot 2024-07-01 at 08.46.58.png](https://community.atlassian.com/t5/image/serverpage/image-id/332681iA1BAEF174B9FD520/image-size/large?v=v2&px=999 "Screenshot 2024-07-01 at 08.46.58.png")

This is the basic setup:

![Screenshot 2024-07-01 at 08.47.12.png](https://community.atlassian.com/t5/image/serverpage/image-id/332682i7B5913EFC563E156/image-size/large?v=v2&px=999 "Screenshot 2024-07-01 at 08.47.12.png")

And the result from the audit log:

![Screenshot 2024-07-01 at 08.47.21.png](https://community.atlassian.com/t5/image/serverpage/image-id/332683iAE6C00E163210204/image-size/large?v=v2&px=999 "Screenshot 2024-07-01 at 08.47.21.png")

Do you spot something I did wrong?

Kind regards


author: Bill Sheboy
body: Hi [@Glenn Ruysschaert](/t5/user/viewprofilepage/user-id/4054693)

For a question like this, please post images of the complete rule (in one image) and the complete audit log details showing the rule execution (in one image). Those will provide context for the observations / symptoms. Thanks!

Kind regards,  
Bill


Tags: automation

cloud

issue-type

jira-cloud