I would like to conditionally show a transition screen based on custom property set for a jira project. i.e if a project has a certain property set then on particular transition for a issue, it will be shown a screen with some fields to fill in values. If this property is not set, then issue will automatically transition into next state without screen prompt. I m using Jira Rest API to store the entity properties. Jira Entity
How can I access the project custom properties(Set using Jira Rest api) in workflow script condition?
Jira Server (Version: 8.5.1)
Following steps and code worked for me,
1.Create a workflow condition(refer code block below) on the transition with the required screen.
2. Create a parallel transition to allow normal flow without screen and a workflow condition which sets passesCondtion as true when property values are not set.
Jira Rest API Used to store property: /rest/api/2/project/XYZ/properties/project_custom_id
Project Key: XYZ
Property Name: project_custom_id
def projectKey = issue.projectObject.name
passesCondition = false
ApplicationUser user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();
ProjectPropertyService pps = ComponentAccessor.getComponent(ProjectPropertyService.class);
EntityPropertyService.PropertyResult pv= pps.getProperty(user, "XYZ", "project_custom_id");
Option<EntityProperty> jsonValues = pv.getEntityProperty();
def pv_value = jsonValues.getOrNull()
// Add conditional checks for the property values using pv_value.getValue() and set passesCondtion as true when required property values are set.
Hello Community! I hope you've been enjoying the 🍂Apptoberfestivities🍂 (I know I have!) The event is heating up next week with a series of virtual events that we're calling the 🍻🍂Partner App ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events