How to ensure a field is properly filled before ticket creation?

Deleted user September 22, 2021

hi all

i am a beginner with JIRA.

 

I would like to make sure when creating a bug that thi one is linked to an specific existing issue.

To do so, i was able to make compulsary the field linked issue.

The point where i am stuck is that in the dropdown list i have, different types of item are listed : BUG - EPIC - STORY ...

I would like to make sure, before creating the ticket, that the linked issue is of a certain type (Tasks) from a dedicated project?

thanks

3 answers

0 votes
Deleted user October 13, 2021

Is it feasible through a behaviour to check the content of the field "issue":

 

Capture.JPG

 

something like :

 

import com.atlassian.jira.component.ComponentAccessor
//import com.atlassian.jira.issue.fields.CustomField

boolean output = false
// store into a variable named linkedIssue the content of the field Linked Issue
String linkedIssue = getFieldByName('Linked Issues')

// check whether the linked issue starts with PRJ- => if no issue
if((linkedIssue.substring(0,3)!="PRJ-")){
output= false
}
else{
output= true
}


return output

0 votes
Narendra Kumar September 23, 2021

Hi @[deleted]  welcome to atlassian community!

You will see an option in workflow of Jira to apply validator on specific transition. If you want, you can set it on "Create" transition to check if specific field is having the correct value or not. 

For example, if you want to check the field should be given only number value, see here https://confluence.atlassian.com/jirakb/using-workflow-regular-expression-check-validator-to-restrict-text-field-in-number-format-859509784.html

 

In general way - you can use "Field Required Validator" to check if field is not EMPTY. See here https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-validators-with-custom-fields/

Also, there are some add-on which are really helpful to create validation of custom format. 

https://marketplace.atlassian.com/apps/292/jira-misc-workflow-extensions-jmwe is a great add-on to do such implementation in Jira.

Hope it'll work for you.

Regards,
Narendra

0 votes
Alan Stephenson
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 22, 2021

Hi,

I would have to test, but, I think what you could do is create a validator on ticket creation specifically for BUG issue type (i.e. the workflow is only for issue type = BUG). I am going to try a quick test and see if it works, then report back.

-alan

Alan Stephenson
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 22, 2021

After looking at this a little, not sure if this can be done on ticket creation. See below:

Linked Status Validator cannot be used in the Create transition (the one which is performed, when a user creates a new issue). This is mainly due to technical reasons that at stage the 'issue linking' is not established and the validator cannot find the linked issues and also not validate it.

In our instance we are using a plug-in JSU that has a validator called "Linked Status". This works well when trying to transition issues or make a ticket impossible to close if a linked ticket is not closed. See this link from the documentation of that tool:

https://beecom-products.atlassian.net/wiki/spaces/JSU/pages/25680475/Linked+Status+Validator

This is where I grabbed the reference on the Linked Status Validator. 

 

Another option you could do with this plug-in, is to let users still create issues and bugs. Before they move the ticket to the next status you could put in a validator clause to check a linked issue exists on BUG. There may need some coding and an additional plug-in like JMWE (jira misc workflow extensions). 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events