Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Writing a logic query for a workflow

Donnie Richardson July 11, 2022

For a ticket the user wants a ticket to be structured a certain way, a user wants the fields "type" and "name" to be required when the value for the "Components" field has been selected to "Third party Vendor" I was trying to write a logic query as a validator in the workflow transition when the ticket is being created. I just don't know how to write it exactly. I could use some help, or guidance on this. 

1 answer

0 votes
Craig Nodwell
Community Champion
July 11, 2022

Hi @Donnie Richardson welcome to the community.
Couple questions.
What do you mean by Type and Name ?
Are these custom fields?
Is this the Jira Issue type?
Is this the Jira Issue Summary?

Donnie Richardson July 11, 2022

Thank you for your time @Craig Nodwell , to answer your questions, yes,

 

"type" and "name" ae custom fields that need to be required to be filled in when the value for the "components" (system) field is, or contains "Third Party Vendor" 

I was able to write out the first part, but it seems like this calls for an "or" statement in logic, as there are components that are not "Third Party Vendors" and the "components" system field is not required upon creation of the ticket, just when "Third Party Vendor" has been selected.

 

I hope this information helps.

Craig Nodwell
Community Champion
July 11, 2022

Based on the last statement I'm thinking you're writing an automation.
Have a look here.

Donnie Richardson July 11, 2022

Thank you @Craig Nodwell this is for Jira? not just for Jira Cloud? and tis can be used for a workflow? I read the article, and was not sure. 

Craig Nodwell
Community Champion
July 11, 2022

Depends on what version of Jira you are using.
Can you identify you version.  I could have jumped the gun there....
And maybe if you could be more clear on the "I was able to write the first part"
Do you have a plugin like Scriptrunner?  What did you write the first part in?

Donnie Richardson July 11, 2022

Sure thing @Craig Nodwell the version of Jira I am working on is: 

Jira v8.20.7 

for the logic statement I had written down, it was :  %{Components} = "Third Party Vendor" and %{Type}!="null" and %{Name}!= "null" or %{Components}!= "Third Party Vendor"

the ticket for selecting the "Third Party Vendor" worked, as when it was selected, you received the error message that "type" and "name" (those custom fields) needed to be filled out as well.

but it prevented me from creating a test ticket where you didn't have to select "Third Party Vendor" in the "Component's" system field. so i tried to create an "or" statement. but i kept running into issues.

 

the first part is: "%{Components} = "Third Party Vendor" and %{Type}!="null" and %{Name}!= "null" and that seems to work.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events