I am trying to write a complex condition (if statement) in scriptrunner for a custom field that is an issue type to check the value of another custom field, then transition that issue. Then if all the issues equal the same status then it will transition another issue type to another status. This will use 2 workflows that talk to each other. Example below
I have enough coding experience to know that this doable but the custom fields and transitions are confusing me with JIRA
So for an example:
issue type 1 - dealership (customField)
issue type 2 - manager (customField)
field - car (customField)
options in car - "in stock" ,"out of stock" , "preorder"
issue status (1) - Search
issue status (1) - Add to cart
issue status (1) - Buy
issue status (2) - Sold out
1s go with issue type 1 & 2s go with issue type 2
Problem
When status goes from, "search" to "add to cart", check if in "dealership" that "car" has the value "in stock". If value = "in stock", then transition "dealership" status to "buy". If all dealership's status is buy then transition "manager" to "sold out"
Logic
When status search transitions to add to cart
Then for dealership
if car = in stock
Then status transitions to buy
If all dealership status = buy
then transition manager to sold out status
I tried this multiple times with automations but nested for if statements aren't possible. I may can do this with 2 automations at the same time but I get errors.
Feel free to ask questions for more details because I am aware of the complexity. The getting the value/status of custom fields stomped me.
Please help.
Having it be two different issues makes this extremely complex. At first I thought maybe a listener, but again the two different issues.
I have a couple of questions, do the issues use the same workflow? Is one of the issues a subtask of the other? I will probably have more questions, but this will be a good start.
Thanks,
Tim
Hi @Tim Perrault so I will answer your question in parts to give more detailed answers.
- "do the issues use the same workflow?"
- "Is one of the issues a subtask of the other?"
I hope this helps, feel free to ask more questions to understand. I'm looking to have 2 automations that happen one after another to make this doable.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.