Hi,
How to make custom field appear on screen based on issue type, for example I have 5 issue types and all have one screen configuration but now there is change request, when user select issue type incident then along with other custom field i need to make due date mandatory on screen and incident type (custom field) which has drop down list p1 p2 so on appear on the screen.
Any suggestion pls
Hi @Manoj
I agree with @Dave Mathijs
But, if you think that you will have to make so many changes to accommodate the new change request and if you have ScriptRunner installed in your instance, you can try this using 'Behaviors'.
Hope this helps.
Thanks,
Vamsi
Hello @Vamsi Kandala Thanks for replying back to me, i really like the response.
yes i do have ScriptRunner installed but that sound me a new thing which i have very less knowledge, how i can use "Behaviors" (i am going to read about it), any steps you can mention here ? or you can explain it in hypothetical way.
i will look forward for your response further.
Take care!
Thanks
M
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Vamsi Kandala Hello, I am glad to share that i have used scriptRunner to achieve this change request, its working fine!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Manoj
Sounds good. I am sorry that I could not check your response and reply earlier. Glad that you are able to figure it out.
Behaviors is a very useful tool which can be used for many functionalities.
Thanks,
Vamsi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Vamsi Kandala Hello, Hope you are fine!
yesterday i tried working in pre-prod and everything worked fine whereas today i have implemented the same thing in prod now it is working partially, fields are appearing based on issue type selected but not becomes mandatory* field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Manoj
I am doing good. Hope you are doing good as well.
In the script, can you replace:
getFieldById("Incident Priority").setRequired(true)
In the above code 'getFieldById' expects the id of the custom field and not the name. Can you replace 'Incident Priority' with its custom field id and try?
Thanks,
Vamsi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Vamsi Kandala Thanks for replying me back, can you believe its working i just replaced as you have mentioned above, Kudos to you!
could you guide me how to get into in ScriptRunner part, and i believe groovy is the base of it, btw i dont know anything about groovy language, could pls tell me how i can give a start into it?
hope i am taking your too much time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Manoj
Glad that you are able to work it out.
There is plenty of useful documentation for ScriptRunner at their web site: https://www.adaptavist.com/products/atlassian-apps/new-documentation-scriptrunner with examples.
Hope this helps.
Thanks,
Vamsi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Vamsi Kandala hello, Happy new year, thanks for sharing above link, it is helpful.
I have to task, i want to create kanban task with pre-defined subject line, and this get created in every 2 months. how do i get this done via script? Kindly suggest.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Manoj ,
Thank you, Happy New Year to you as well.
If I understand correctly, you want to create a Kanban task automatically every two months.
If that is so, you can user 'Automation rules' with the trigger as 'Scheduled'. Then you use cron expression to define when you want to create the ticket and how frequently. More documentation and examples can be found here: https://support.atlassian.com/jira-software-cloud/docs/construct-cron-expressions-for-a-filter-subscription/
Then use the 'Create issue' option for 'New action' component.
Hope this helps.
Thanks,
Vamsi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Vamsi Kandala Hello, Hope you are good.
about that due date mandatory, now it becomes mandatory for all issue types in project, as in my absense another project interrupt setting. now i want to make due date mandatory only for 2 issue types. any suggestion pls.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Manoj
I am doing good and hoping the same with you as well.
You can use the ScriptRunner Behaviors to set the field as mandatory by adding the project mapping to the related project and for the specific issue types only.
Hope this helps.
If you need further assistance, I can send you the steps about how to do this.
Regards,
Vamsi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Vamsi Kandala I am also keeping well, Thanks for asking.
on your given solution, i have tried this and working now :) what i missed earlier is that, i use all issue types and missed to recollect as earlier i read somewhere that the issue types only to be used which we want to have some behavior.
Also, i have few custom fields which i want to automate, if i fill the inputs in one custom field then based on first first field, rest few fields get autofilled.
for example- am running an hr project and in which i have specific role, standard role and broader role
so specific role- backend developer, standard role - developer, broader role - development.
How would i start putting in script runner/behavior ? could you pls suggest.
So far i have learnt is below :
import com.atlassian.jira.component.ComponentAccessor
def cfSpecific Role = getFieldById("customfield_122321")
def cfStandardized role = getFieldById("customfield_23601")
def cfBroader Category = getFieldById("customfield_24652")
def cfNext Level Category = getFieldById("customfield_24254")
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.
Hi @Manoj
I am doing good. How are you?
Sorry, I missed your earlier comment.
If you are familiar with Behaviors, you can write the script for by selecting the field which should trigger the changes. In this case, it would be 'customfield_122321'.
Then try adding this code and see if that works:
def cfSpecificRole = getFieldById("customfield_122321")
def cfStandardizedRole = getFieldById("customfield_23601")
def cfBroaderCategory = getFieldById("customfield_24652")
def cfNextLevelCategory = getFieldById("customfield_24254")
if (cfSpecificRole.getValue() != "") {
cfStandardizedRole.setFormValue(cfSpecificRole.getValue());
cfBroaderCategory.setFormValue(cfSpecificRole.getValue());
cfNextLevelCategory.setFormValue(cfSpecificRole.getValue());
}
Hope this helps.
Thanks,
Vamsi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Vamsi Kandala Thanks for your reply, I just tried above given script, but unfortunately it is not working properly, for example- when i select backend developer (in specific role)
then standardized role filled up but broader & next level category does not show the value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Manoj
I have tested at my end and it is working.
Can you send me the complete script code if you don't mind?
Thanks,
Vamsi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Vamsi Kandala Hi am not much familiar with behaviours (willing to learn)
but here is the script i am using. Not even sure whether its completed or not.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Vamsi Kandala what i realized is, i need to make the roles dependent at the backend (dont know how).
like Specific role - Standard role- broader category- next level category
"Developer-BE"-"Developer"-"Development"-Developer"
"DevQA Auto"-"DevQA"-Development"-QA",
and to project like above in scrip, so that if i select Developer-BE in specific field then rest of the fields pops up.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI @Manoj ,
First of all, you need to split the issue operation screens (create, edit, view) per issue type and configure them in the Issue Type Screen Scheme.
Then you need to create a separate Field Configuration per issue type and configure these in the Field Configuration Scheme.
Finally, make the designated fields required in the Field Configuration for that issue type.
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.
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.