Automation that checks for field value and prompts user
Asked by Martin H?rri:

Is it possible to write an automation which does the following:

- when a user hits the "save" button

- checks if a field meets a specific condition (e.g. Assignee is not empty)

- if that condition is not met, prompts the user with something like "Please add an Assignee before saving the issue"

- does not allow the user to save the issue until that condition is met


Answers:
author: Martin H?rri
body: In case someone is interested in how we eventually addressed that topic.

Workflow cannot be used, as we want to perform such a check when a user updates an issue, not when it is moved in the workflow. So we decided to use Project Automation.

However, it is not possible to display a prompt, the best thing we could come up with was to send an e-mail to the user informing them about what they should fix.


author: Anthony Morais
body: Hi [@Martin H?rri](/t5/user/viewprofilepage/user-id/1541979)

You can do this through Workflow, it would be more or less following the step by step below:

Edit the workflow.

![validators.png](https://community.atlassian.com/t5/image/serverpage/image-id/267425i172358B283F932A2/image-size/large?v=v2&px=999 "validators.png")

Add a validator

![add validator.png](https://community.atlassian.com/t5/image/serverpage/image-id/267427i35B100984C8E11C5/image-size/large?v=v2&px=999 "add validator.png")

Add a Field Required Validator

![field required.png](https://community.atlassian.com/t5/image/serverpage/image-id/267429i974121D59FD60DF5/image-size/large?v=v2&px=999 "field required.png")

Choose the Assignee field and put the desired message, after doing so, publish the Workflow

![message workflow.png](https://community.atlassian.com/t5/image/serverpage/image-id/267430iFFF40A859303F343/image-size/large?v=v2&px=999 "message workflow.png")

I hope it helps!

Regards,

Anthony


author: Darryl Lee
body: Hi [@Martin H?rri](/t5/user/viewprofilepage/user-id/1541979) -

So, Jira implements "buttons" as transitions, that are part of a workflow, like [@Anthony Morais](/t5/user/viewprofilepage/user-id/5204654) laid out. These transitions can include validators that check that the Assignee field is not empty.

Normally these transitions are used to move an issue from one step to the next (Open -\> In Progress -\> Review -\> Done).

But transitions can also be used as a workaround to the problem that [@Alexander Pappert](/t5/user/viewprofilepage/user-id/1139063) mentioned. Ever since Jira implemented Inline Editing, allowing changes to fields **outside of transitions**, it made it a little harder to prevent users from changing a field without proper validation.

The workaround to force a validation on edit is to:

* Create different screens for View and Edit
* Remove the mandatory field from the Edit screen
* Create an Edit transition with the fields you want to check, and have this transition "loop back" to itself.

There's details on this here: [How to Disable Inline Editing](https://confluence.atlassian.com/jirakb/how-to-disable-inline-editing-376833061.html)

The screenshots are from Jira On-Prem, so if you are on Cloud, the "buttons" are now a drop-down menu. But functionally, the concepts are the same.


author: Alexander Pappert
body: don't think you can do it on issue edit

a mandatory field on edit just checks that some value is filled, but no specific value check

you can do this with automation addon after issue edit/creation and send a mail to the user who changed the issue that he needs to correct the value - but no guarantee that he will do this.