Restrict workflow transition to a specific project in JIRA

Ramya Yarru February 12, 2021

Hello,

I'm applying a post function to a workflow to update JSU field value to a workflow which is shared by other projects, is there any way to restrict this post function only for a specific project rather than effects all other projects using the same workflow.

Kindly advise.

3 answers

1 accepted

0 votes
Answer accepted
Manuel Galván
Contributor
February 12, 2021

@Ramya Yarru have you checked if your post function is after the precondition and had "Precondition must de True" checked?

 

image.png

Ramya Yarru February 12, 2021

Yes @Manuel Galván

Please find the attached screenshot.

Capture.PNG

Manuel Galván
Contributor
February 12, 2021

@Ramya Yarru I see that you are using it in the create issue, maybe this is the problem, try in another transition to discard it

Deleted user February 15, 2021

Hi @Ramya Yarru ,

 

Have you tried using the Value in Field Precondition. Please see a simple example as shown below Precondition.png

The above precondition will check if you are creating the issue in the project SJSU and then only execute the postfunction. 

We have also internally created a support request in our portal for the same if you need any further help. 

Please sign up to our portal and let us know so that we can provide you the required access to the request. 

Regards,
Vijay Ramamurthy

0 votes
Ramya Yarru February 15, 2021

@Manuel Galván  Sure, will try that :)

 

@[deleted] Yes, I was able to achieve this using value pre-condition but I have a query. I have a condition to check if the Project belongs to Project A or Project B and only if this is satisfied then execute Post function. Should I add 2 preconditions ( 1 for Project A and other for Project B) using update value and 1 post functions or should I add 1 pre condition for Project A -> Post function and another for Project B -> Post function?

Post function is the same for both Project A and B.

Deleted user February 15, 2021

Hi @Ramya Yarru ,

 

You can use precondition with postfunction similar to the one shown below 

2021-02-16_13-16-47.png
As per the above screenshot if the Project is SJSU then the summary field will be copied to description. If you try for other projects lets say test then the summary field will be copied to the custom text field. 

Regards,
Vijay Ramamurthy

Ramya Yarru February 16, 2021

JSU.PNG

 

 

 

@[deleted] PFA, I have 2 preconditions and both should be applied to both post functions. Is the above approach fine or should I defined Step 1 and 2 again for Step 4 (clear Field value). As of now it works but I just want to get confirmation on correct procedure.

Deleted user February 17, 2021

Hi @Ramya Yarru 

 

Yes the way you have configured should work for both CWAP and CWAV projects. 

Please let us know if you need any further information .

 

Regards,

Vijay Ramamurthy

Ramya Yarru February 17, 2021

Great, thanks for confirming :)

0 votes
Manuel Galván
Contributor
February 12, 2021

Hi @Ramya Yarru we use JMWE, it lets you add a any groovy condition. If you use JSU, then you can add 'Precondition: JQL (JSU)' and in JQL Expression filter by project.

Ramya Yarru February 12, 2021

Hello @Manuel Galván  Thank you for your answer.

I have used a precondition and set the precondition to true on my post function but that did not work and effected all other projects associated to workflow.

Please find the attached screenshot on pre-condition

pre-condition.PNG

Suggest an answer

Log in or Sign up to answer