We need a condition to validate if an object is already created in an object schema and do not permit to create an issue with this object value in a specific field.
Thank you
I'm not 100% sure I understand your use case, but it sounds like you have:
You asked
a condition to validate if an object is already created in an object schema and do not permit to create an issue with this object in a specific field
First things first.
It sounds like what you might want is to alter the "Filter scope (IQL)" section in the field configuration to apply your logic. That way, the field will only show the objects which satisfy your logic.
For the 2nd bullet: I dont want an insight field. I want a text or integer field to fill and if this value does not exist as an object in insight then an issue and an object will be created.
I suppose I will use the insight post function but I will need help with the IQL condition
So, it sounds like you're using an issue as the template to create an object.
You have a couple of options.
1. You can put all of your logic in the create workflow validator to determine if an object exists which matches the text or integer field. If the object already exists, throw an error message to the user and not let the issue be created. If the object doesn't exist, then create the object and let the issue creation succeed.
2. Let the issue get created, and then have either a post-function that performs the above work and then transitions the issue to a completed status with a resolution of "object created" or "denied" or something like that.
If I select the first option I suppose I will create a Validator on the Create transition. I will select Insight Validators --> Run a groovy script within this validator.
Can you help me with the groovy code I will use?
It looks like you're new here. Sign in or register to get started.