Jira - Findings&Followups should be filled before review task is closed
Currently if user does not fill 'Reviews & FIndings', they can still close the 'Review' Type tikcets.
Need to set condition to check if its filled before closing the review task or it should show error to fill and shouldn't allow to move to CLOSED status.
Option-1: User should choose one of the status 'Corrected','Rejected','Postpone' in REVIEW FINDINGS to move status to CLOSED.
If above option is not feasible, Try the below
Option-2: Only if the status of the checklists in "Review Checklist - Type Specific:" is DONE, user should transition to CLOSE.
Hi Mummareddy,
You should add a Field Required validator to the transition going to Closed in your workflow.
@John Funk I configured as below but its not working, may i know that if i need to add anything here please let me know
Thanks in advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You should have a regular Field Required validator and not have to use a plugin. Can you share a screen shot of the options for Add Validators?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@John Funk I need to Achieve this below scenario,Please guide me here how can i do it
Option-1: User should choose one of the status 'Corrected','Rejected','Postpone' in REVIEW FINDINGS to move status to CLOSED.
If above option is not feasible, Try the below
Option-2: Only if the status of the checklists in "Review Checklist - Type Specific:" is DONE, user should transition to CLOSE.
IS it possible to check if we can have a JQL to see if we can filter out the checklists based on the above mentioned statuses and have a NOT condition. If True, error message to appear.
Using with Required field validator unable to set above condition User should choose one of the status 'Corrected','Rejected','Postpone' in REVIEW FINDINGS to move status to CLOSED.
Thanks in advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So you probably need two different transitions to Done - one with the Condition where the conditions meet what you have in number 2 above (like what you have with JSU above) and the other one where it does not meet those conditions. Then add a transition screen with the Resolution field in the screen for the second transition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@John Funk ,In Workflow validator i took custom script runner ,using groovy script i'm trying to Achieve the this point Option-1: User should choose one of the status 'Corrected','Rejected','Postpone' in REVIEW FINDINGS to move status to CLOSED.
The below script i used,i'm able to feth Review findings with ID(example:12345)but unable to fetch the status of review findings values like Corrected','Rejected','Postpone.I'm getting the error as need to fill one of this values corrected and rejected but i filled it in ticket.Script is unable to fetch it may i know reason please.Can you please guide me how can i fetch the status of review find
Script:import com.atlassian.jira.component.ComponentAccessor
import com.opensymphony.workflow.InvalidInputException
import org.apache.log4j.Logger
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def debugLogger = Logger.getLogger("com.acme.YourPlugin")
def reviewFindingsField = customFieldManager.getCustomFieldObject(12345) // Use the custom field ID directly
if (reviewFindingsField == null) {
throw new InvalidInputException("Error: The custom field with ID 12345does not exist.")
}
// Retrieve the custom field value (handle collections)
def reviewFindingsValues = issue.getCustomFieldValue(reviewFindingsField)
if (reviewFindingsValues == null || reviewFindingsValues.isEmpty()) {
throw new InvalidInputException("Error: The REVIEW FINDINGS field is empty.")
}
// List of allowed IDs and names
def allowedValues = [
"corrected": "Corrected",
"rejected": "Rejected",
"postpone": "Postpone"
]
// Check the type of the reviewFindingsValues to understand its structure
debugLogger.debug("Review Findings Values Type: " + reviewFindingsValues.getClass().getName())
// Initialize a list to collect extracted IDs
def extractedIds = []
// If reviewFindingsValues is a collection, iterate through each value
if (reviewFindingsValues instanceof Collection) {
reviewFindingsValues.each { checklistItem ->
def checklistItemId = checklistItem.toString().toLowerCase() // Assuming checklistItem is a string
extractedIds.add(checklistItemId)
}
} else {
def checklistItemId = reviewFindingsValues.toString().toLowerCase() // Assuming reviewFindingsValues is a single value
extractedIds.add(checklistItemId)
}
// Check if any of the extracted IDs are in the allowed IDs
if (extractedIds.any { allowedValues.keySet().contains(it) || allowedValues.values().contains(it) }) {
return true
} else {
throw new InvalidInputException("Error: The REVIEW FINDINGS field must be set to 'Corrected', 'Rejected', or 'Postpone' to close this ticket.")
}
Thanks in Advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for sharing, but I am not an expert on ScriptRunner. Why not just add a simple transition screen with that field on it for the transition to Done? And then add a simple built-in Validator to make sure the field is not empty (Field Required Validator)?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried using Field Required Validator , In that we just have option to mention which field should be empty.but not having option to check whether user has filled the status to Done or with some other status.So I through as it wont work for this scenario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The other way to do that would be to create a self looping transition with the Transition Screen. Include your Field Required Validator to make sure that it is filled in. Then have an automation rule based on the item status/resolution field being updated that will auto transition to the correct workflow status.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not sure how to do it ,if possible can be little clear on this.If possible please provide me steps how can i dot it please ,a self looping transition with the Transition Screen.
Thanks in advance .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry - You create a new transition that goes from a status back to itself. In other words the to and from statuses are exactly the same. It's known by some as a looping transition.
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.