The Procurement project have many issue types "Project , invoice , task, idea" every issue type has its own workflow
If the issue type is "Project", we set the field "Need invoicing" to "Yes" if there is a need to invoice, then we create a ticket on the same project with issue type "Invoice" and linke it to the main ticket. When the Invoice ticket is set to status "Invoice is paid", it is closed with status "Invoiced"
When we close the main ticket we need to add a condition, if the "Need Invoicing"= "Yes" the linked ticket with "issue type" = "Invoice" its status should be "Invoiced"
How can we implement this condition? as this issue is impacting the business
a detailed script runner example is highly appreciated.
Note: we may have couple of subtasks and couple of linked tickets in the main ticket
Thanks
Hello @Mohamed El Taweel
As @Tarun Sapra says you can do it with simple scripted validator.
Here is example of condition:
def linkIssues = issueLinkManager.getOutwardLinks(issue.id)*.destinationObject
!(cfValues['Need Invoicing']?.value == "Yes" && !linkIssues.any{
it.status.name == "Invoiced" && it.issueType.name == "Invoice"
})
I used
def linkIssues = issueLinkManager.getOutwardLinks(issue.id)*.destinationObject
!linkIssues.any{
it.status.name == "Invoiced" && it.issueType.name == "Invoice"
}
But it always return True
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Mohamed El Taweel
You can easily implement your requirement by adding a custom validation in the transition of the mail ticket to status close. Such that when mail ticket is moved to closed then you check the value of custom field "need Invoicing" and then check the status of linked tickets of types "Invoice"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Script Validator examples
See this sample
and then add a error message which you desire to be shown to user.
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.