To create issue just if it's not under specific issue type
Asked by Hadassa:

Hi :)

I need to check when a new issue is creating,  
if the parent of this issue equals to Epic:

if it is- the creation will be cancelled  
and if it is not equals, just then, the new issue will created

I did it with validator on the creating transition that-  
checking if the parent issue, is not equals to Epic,  
and if it is not- so the issue will created

it's working well, but not with mine massage error..

waiting to your answer :)

![validator.PNG](/t5/image/serverpage/image-id/344021i0DD54985FE3A44B9/image-size/large?v=v2&px=999 "validator.PNG")


Answers:
author: Marc - Devoteam
body: Hi [@Hadassa](/t5/user/viewprofilepage/user-id/5576736)

There is no option to check any validations before creating an issue in Jira.

There is nothing to validate on if there is no issue created and the parent - child relation is there.

On issue creation you can only validate if certain fields have fields filled with data before creation.

comments: author: Hadassa
body: thanks' [@Marc - Devoteam](/t5/user/viewprofilepage/user-id/3796976) for your answer,

I'm talking about parent - child relation,

how can I make parent - child relation on mine issues-

or, how can I know if there is already?


author: Marc - Devoteam
body: Hi [@Hadassa](/t5/user/viewprofilepage/user-id/5576736)

You can't.

On issue creation there is no way to validate on existing other Jira information, as the issue doesn't exist yet.


author: Hadassa
body: ok... got it [@Marc - Devoteam](/t5/user/viewprofilepage/user-id/3796976)

so what about 'Relates issue validator'

like what I trayed to do?


author: Marc - Devoteam
body: Hi [@Hadassa](/t5/user/viewprofilepage/user-id/5576736)

As I explained, this can't be done in any way.

It's the same as, example;

I only want to park my car if the garage has cameras on each parking space, if I'm in front of the gate how can I validate?

I would first need to be in the garage, to validate.


author: Hadassa
body: Hi [@Marc - Devoteam](/t5/user/viewprofilepage/user-id/3796976)

so what is it for? this validator?


author: Marc - Devoteam
body: HI [@Hadassa](/t5/user/viewprofilepage/user-id/5576736)

This can be used on other transitions in a workflow, but not on create

If an issue is not in the system, it can't have a link to another issues, because it doesn't exist yet.

This validator can be used on issues that exist and might have a link to another issue.

You can only validate on issue creation if fields are provided before creation.

If an issue doesn't exist in the system, you can't validate it with existing data.

Another example;

If I bake a cake and you want to bake a cake to see if its more delicious then mine, you would need to create to first


author: Hadassa
body: Ok, got it now!  

This validator not intended for the creation transition,

That's what I needed to understand,

Thank you [@Marc - Devoteam](/t5/user/viewprofilepage/user-id/3796976) that was helpfully

<br />

By the way-  
your examples were great :)


author: Jerrold - Empyra
body: HI [@Hadassa](/t5/user/viewprofilepage/user-id/5576736)

Can you please share the error message you are getting instead of the given error message and also can you check if this transition has any other validators similar to this.

Thank you.

comments: author: Hadassa
body: thank you, Jerrold for your answer  

I just try it now,

and it's not working at all

and the transition doesn't have any validator similar like this .


Tags: data-center

jira-data-center