简体   繁体   中英

How to make a field required only on a Workflow Screen in Jira

I am configuring Jira for bug reporting, I have customised the create/edit/view screens for creating a "Bug" issue type and defined a custom workflow, two of my workflow steps "resolved" and "closed" have custom screens or "views" as they appear to be called in the workflow configuration

So far I can't see any way possible to make a field required in only the "resolved" or "closed" views/screens because I cannot assign a field configuration to these screens.

If I just try use the default field configuration assigning different fields to different screens, the fields will show as required on the screens I have mentioned, however they will also be required in the "create" etc. screens even though they have no association with those screens

Has anybody successfully setup required fields in Jira for workflow screens without that field being mandatory on subsequent screens? I think I've tried almost every possible combination of configuration to do this without resorting to plugins or hacking

You need to make that change in the workflow.

If you are working on an active workflow then go to workflows and make a copy of it. Then in the copy, click on the *transition" that you want to have the required field. So if you want the move from "resolved" to "closed" to have a field be required then click on the "resolved" transition called "close issue".

In here you should see tabs for *conditions", *validators", and "post functions". You want to create a validator . Go to validators and click add .

Here it will give you a choice of all sorts of validators. Hopefully one of the is "fields required"*. Choose that validator and click "next". It will then give you a multi-select list to chose which fields should be required for this transition. Simply choose the fields you want required and hit "next".

Once this is all done you will then need to activate that new workflow. Which in volves adding it to a workflow scheme and then assigning that workflow scheme to your project. If you need help with that part, then post a new question and leave me a comment and I'll try to help you out.

I have been doing a LOT of work with custom workflows lately and the power and versatility is simply staggering.

*I say hopefully because I have the "fields required" option, but I have also installed a couple of Workflow plugins that may have added that one. If you don't have it then you may need to install on of these plugins:

  • JIRA Misc Workflow Extensions
  • JIRA Suite Utilities
  • JIRA Toolkit Plugin
  • Workflow Essentials for JIRA

You can configure the validators in the workflow transition. I have explained detail in the below blog post along with the screenshots. https://codetolive.in/jira/How-to-make-custom-fields-required-in-a-workflow-transition-in-jira-script-runner

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM