Hi,
How can I implement the following post function on the close transition
Check that all linked issues which belongs to the Invoice issue type has transitioned through the "Invoice Paid" status
Note: this can be done from jql using
status was "Invoice Paid"
Thanks
You said you want a postfunction, but what you want is a condition. What the postfunction should do if the condition is true?
Regards!
Anyway here is the code for what you want (I think)
import com.atlassian.jira.component.ComponentAccessor
def issueLinkManager = ComponentAccessor.getIssueLinkManager()
def transition = true
issueLinkManager.getOutwardLinks(issue)?.each {
linkedIssue ->
if (!linkedIssue.destinationObject.status.toString().equals("Invoice Paid")) {
transition = false
}
}
if (transition = true)
Hi,
Yes, true it is a condition
Q- Will (linkedIssue.destinationObject.status.toString().equals("Invoice Paid")) return true
if the current status is "Invoice Paid" or it is transitioned through "Invoice Paid"
What I need is to check, if (the current status is "Invoice Paid" or it is transitioned through "Invoice Paid") then return true
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This checks if the linked issues statuses are "Invoice Paid". If it finds an linked issue that is not in "Invoice Paid" status it will return false
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
- I know how to check the current status.
- What I need is to check, if (the current status is "Invoice Paid" or it is transitioned through "Invoice Paid" to another status "Done" for example) then return true
Don't know if script runner can achieve this or not, as far as I know I can simulate this using JQL ==> status was "Invoice Paid"
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can access to the history of the issue with scriptrunner and know if the issue was in that status, but i dont get the point if you already solved it with JQL.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Issue not solved because the condition should be implemented using script runner, so how can I access the history of the issue with scriptrunner and know if the issue was in that status or not.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, the easiest and fastest way to resolve it, is using scriptrunner jql condition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Highly appreciating if you explained How with an example?
Thanks
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.