Forums

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

get all linked issues transitioned through the "Invoice Paid" status

Mohamed El Taweel August 29, 2018

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

1 answer

0 votes
Atlassian Tecnofor August 29, 2018

Hi @Mohamed El Taweel,

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)
Mohamed El Taweel August 29, 2018

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,

Atlassian Tecnofor August 29, 2018

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

Mohamed El Taweel August 29, 2018

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

Alejandro Suárez García
Atlassian Partner
August 29, 2018

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.

Mohamed El Taweel August 29, 2018

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

Alejandro Suárez García
Atlassian Partner
August 30, 2018

Hi, the easiest and fastest way to resolve it, is using scriptrunner jql condition.

Mohamed El Taweel August 30, 2018

Hi,

  Highly appreciating if you explained How with an example?

Thanks

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events