Hi All,
I have tried using behaviour and putting my script in the Initialiser and in the server script as well for the corresponding field but the validation does not seems to work.
Requirement -
Based on the Issue type I need to make a custom field mandatory while creating the issue --- Already done
But at the time of Editing the issue and changing the Issue type the corresponding field does not become mandatory or non mandatory on the basis of issue type?
Hi Fabio,
I have written the same script in both the places already.
But at the time of Editing the Issue if I change the issue type say from task to Bug then the corresponding "Root cause" field does not become mandatory and vice-versa. Please could you go through the script and let me know the changes .
Hi @shrikant maheshwari ,
Initializer works when you open the edit/create screen.
If you want that your code works when change a specific field you need to add the same script also for that field. In your scenario, you need to put the same code at Issue Type field level
It should fix you issue.
Ciao,
Fabio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @shrikant maheshwari ,
if you need to make field mandatory based on issue type, the best pratice says to use Field Configuration Scheme based on issue type.
Btw, your code should work, I jest tested it in my local environment.
Please could you share the mapping for your behaviour?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Fabio,
please find the mapping screen shot and the problem is when i am trying to edit an existing Issue and then changing the Issue type to "BUG" then Root cause field is not becoming mandatory its still non mandatory.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @shrikant maheshwari ,
that is the problem. You behaviour currently works just for bug. If you need to work for all issue types (mandatory field should depends form all issue types) you need to edit mapping so that it works at project level and for all issue types.
It should fix your issue.
Fabio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Fabio,
I have already tried that but it does not works, please find the attached screens shots.
Please see the screen shot 2 and 3 , so my original issue was TASK and when i clicked on EDIT and changed the Issue type to BUG still the field root cause is not mandatory.
Also using field configuration scheme based on Issue type will not work as I have to use the validation in both create and Edit screen.
If i try using different field configuration based on Issue type then at the time of Editing the issue suppose a task and then changing the Issue type to BUG it will still show the field configuration for Task only as the Field Configuration is set on the basis of Issue type and not on EDIT issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In my local environment it works like a charm. Please verify that your cf id is correct.
If you selected all issue types as mapping and put your code in Initializer and Issue Type, it should work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Does this work when you have an already existing issue and then you edit the issue and change the issue type to "Task" and then the description field becomes mandatory and vice versa.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@shrikant maheshwari , if you need to setup mandatory fields at creation time please use field configuration. Through the scheme you can define a spefic field configuration for each your issue type. It is a standard approach.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
At the edit time field mandatory on creation will remain as mandatory.
Btw, my behaviour works on both creation and edit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In my case, its working fine at the time of creation but when I edit and change the issue type the field does not become mandatory ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
no please try editing another issue type then task and then change issue type from say bug to task and then see does that field becomes mandatory or is it still non mandatory ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do I have to reset the field as the field remains the same in correspondance to the old ISSUE type and does not change even after editing the issue type
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.