2 fields but it's mandatory to have at least one filled in

Sergio Montávez June 8, 2021

Hi,

I have these two fields Parent Link and Epic Link for an issue type and I would like to do that at least, one of those two, needs to be filled in. Let's say:

  • Issue #1 has Parent Link, so Epic Link is empty
  • I want to set Epic Link with a value and set Parent Link to empty
  • One of these two must always have a value

I don't want to do the validation on a transition because the users are allowed to change these fields any time. A couple of questions

  • Is this possible without an Automation rule? I wanna avoid this approach because it would be triggered after the change is done, so people may overlook it.
  • Can it be done with no extra plug-ins/add-ons?

 

Thank you!

2 answers

0 votes
Daniel Ebers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 12, 2021

There are some requirements from you initial post which will make it impossible (if I am not missing something):

- not in a workflow
 - not a validator/condition
- not using Automation
- without Apps
- directly, anytime an user does a change

I think it cries for some kind of listener, this however will not be possible without App.

Have you made any progress meanwhile?
At least for Automation I'd say it is not the perfect approach, it happens after a transition, a condition would work better (but as you said only during a transition).

Sergio Montávez June 15, 2021

Hi @Daniel Ebers 

I probably misled you by waying "no extra plug-ins or add-ons". Workflows and Jira Automation are welcome. I usually manage mandatory fields in each Issue type field configuration of a Project, but I know it can't be done like that if you want an "or mandatory" involving more than 1 field.

I'm striving for a reactive idea in Automation: given a timeframe of 2 minutes, if both fields are empty, take the value of the last non-empty field and set it back. Then notify the user to solve the issue.

It's not the best approach, but I think it can do the work.

Like JCameron likes this
JCameron March 3, 2023

I'm curious if you ever found a solution to this within the workflow settings. I was just looking to do the exact same thing for epics. To move them to "Done", it must either have a parent link or a fix version. But the validators and conditionals are all basically "AND" operators. 

Right now to avoid "yet another plug-in" (especially ScriptRunner, which is so prohibitively expensive), I'm checking things in an automation that bounce it back so that we can set the conditionals how we want using JQL.

JCameron March 3, 2023

Replying to my own question - thought of this when I flipped back to the workflow. Since it's an "either or", you can do something like have two different possible transitions between the two states, each with a conditional that checks for one of the two conditions. That way if either is set a transition is allowed.

0 votes
Madhumitha N June 8, 2021

One possible way is, if you have Script runner installed you can set Behavior script for those fields.

Sergio Montávez June 8, 2021

Thanks :) The requirement is with no extra plug-ins or add-ons.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events