The condition "entity property contains any user role" not working

Hello everyone!!!
I’ve been encountering a peculiar issue with Jira conditions, specifically related to the entity_property_contains_any_user_role condition.
I have a project property defined as follows:

{
  "key": "myRolesEx",
  "value": {
    "allowedRoles": "Administrators"
  }
}

Now, when I use the entity_property_equal_to condition with the property, it functions correctly as shown in the example below:

"conditions": [
  {
   "condition": "entity_property_equal_to",
   "params": {
    "entity": "project",
    "propertyKey": "myRolesEx",
    "objectName": "allowedRoles",
    "value": "\"Administrators\""
   }
  }
]

However, I’ve attempted to use the entity_property_contains_any_user_role condition in a similar manner:

"conditions": [
  {
    "condition": "entity_property_contains_any_user_role",
    "params": {
      "entity": "project",
      "propertyKey": "myRolesEx",
      "objectName": "allowedRoles"
    }
  }
]

It doesn’t seem to be working as expected. I’m expecting it to check whether the current user is in any of the roles specified in the allowedRoles property, but it’s not behaving as anticipated.

The role Administrators exists for the project, and the user has the Administrators role.

I’d greatly appreciate any insights or guidance regarding why the entity_property_contains_any_user_role condition might not be functioning correctly.
Thank you in advance for your assistance!

Hi there I found a possible solution.
First , you have to create a property on the jira project you are testing. The property has this key = keyForRoleProp and in the json that you send to set the property :

{
  "allowedRoles": ["Developers"]
}

then , the condition we are looking for, has to be like that:

"conditions": [
  {
   "condition": "entity_property_contains_any_user_role",
   "params": {
    "entity": "project",
    "propertyKey": "keyForRoleProp",
    "objectName" : "allowedRoles"
   }
  }
]

Now with this condition, the module only appears to the users on Developer’s role.
Success!

1 Like