Forums

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

postfunction precondition to create linked issues.

Omprakash Thamsetty
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 29, 2020

Hi,

I have a "Biz Design" transition from Requirement state --> Biz Design and

Tech design --> Biz design

image.png

 

I am using Create A Linked Issue (JSU) to create issues during the Biz design transition. I need to create issue if the transition is coming from Requirement state --> Biz Design

How I can have pre-condition. Here I tried with below code but it is not looking the previous condition. linked issues creating all the times. 

 

def PrevStatus = changeHistoryManager.getChangeItemsForField(issue, "status").getAt(changeHistoryManager.getChangeItemsForField(issue,"status").size() - 1).getFromString()

def TureORFalse = true

if( PrevStatus == "Requirements" && issue.getStatus().getName() == "Biz Design"){
issLinkManagerobj.getOutwardLinks(issue.id).each{ fooLink ->
def fooIssue = fooLink.getDestinationObject()

if(fooIssue.summary == "Project Construction Approval"){

TureORFalse = false


}else{

TureORFalse = true


}
}
}else{

TureORFalse = false


}

return TureORFalse

 

Here is my post function configuration. Where I am doing mistake?

 

image.png

2 answers

3 votes
Oliver Siebenmarck _Polymetis Apps_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 29, 2020

Hi @Omprakash Thamsetty ,

I'm neither a Jira Server nor JSU expert, but if do remember correctly, not just any post function will work as a JSU precondition. You will need to use one of the two "Precondition…" post functions provided by JSU to achieve what you are trying to do. Beecom documented the way to do this here.  

Hope that helps,
 Oliver

Omprakash Thamsetty
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 29, 2020

@Oliver Siebenmarck _Polymetis Apps_ Look like you are correct. We have to use Precondition only. Other than those will not work to check as per the document. I have to use those preconditions only to work JSU scripts. 

0 votes
Mathis Hellensberg
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 29, 2020

Hi @Omprakash Thamsetty 

This thread hopefully answers your question by giving you an idea of how to check for previous statuses: https://community.atlassian.com/t5/Marketplace-Apps-Integrations/How-to-get-the-previous-status-of-an-Issue/qaq-p/639638

Hope it helps! :)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events