How to show custom workflow error messages in one simple script validator?

Teja June 7, 2016

Hi,

Can I able to show custom workflow error message in one script validator using if condition  instead of creating separate validator. How to do that any chance to get help on this?

On JIRA issue detail view

image2016-6-7 16:38:7.png

image2016-6-7 16:37:15.png

         image2016-6-7 16:39:35.png

image2016-6-7 16:40:15.png

image2016-6-7 16:40:55.png

Scenario 1 :

When user clicks Approval button it should show " Code Approver, SQL - Stored Proc Approver and SQL-Data Approver Required" error message.

Scenario 2 :

When "Code Approver" checked Approved and user tries to click Approval button now it should show " SQL-Stored Proc Approver and SQL-Data Approver Required" error message.

Scenario 3 :  

When both "Code Approver" " SQL-Stored Proc Approver" Checked and now user tries to click Approval button now it should show " SQL-Data Approver Required" error message.

Thanks

T/

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 7, 2016

Hi Teju,

What you would need to do is to Have a scripted validator which got the values of the custom fields and checked them.

In order to display a popup error message then this can be achieved using the code below.

// Required Import
import com.onresolve.scriptrunner.runner.util.UserMessageUtil

// Custom Error Message
 UserMessageUtil.error('Custom Error Message Here.')

 

I hope this helps.

Thanks

Kristian

Teja June 8, 2016

Thanks Kristian

TAGS
AUG Leaders

Atlassian Community Events