Class EntityPropertyEqualToCondition
- All Implemented Interfaces:
com.atlassian.plugin.web.api.baseconditions.BaseCondition,com.atlassian.plugin.web.Condition
The condition performs an equals comparison on a property value of a primitive type with an expected value. For complex types the condition always evaluates to false. Required parameters:
- entity - The type of entity that should be checked for comparison: issue, project, user, etc
- property key - The key of the property that should be checked for this entity.
- value - The JSON string representation that the entity property value will be checked against.
You may also pass in an 'objectName' parameter which is the '.' separated path to the value you wish to compare against in a large json object. For example, if you had the following value stored in an entity property:
{
"some": {
"nested": {
"structure": true
}
},
"unimportant": "data"
}
If the 'objectName' was set to be 'some.nested.structure' then the 'value' object could be set to 'true' and this condition would be true; resulting in the web fragment being shown. Critically, the 'objectName' parameter will ignore all other data in the JSON stored value. In our example the 'unimportant' JSON field was ignored.
It is important to note that json fields that contain a '.' in their key cannot be referenced using 'objectName'. The 'objectName' parameter expects that the '.' characters are path separators. For example, the following objectName 'one.two' would refer to the json structure:
{
"one": {
"two": true
}
}
But it would not work for the following JSON structure:
{
"one.two": true
}
The first example will be found with 'objectName' whereas the second example will not.
The given entity must available in the JiraHelper context params.
- Since:
- 7.0
-
Constructor Summary
ConstructorsConstructorDescriptionEntityPropertyEqualToCondition(com.atlassian.plugin.PluginAccessor pluginAccessor) -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanshouldDisplay(ApplicationUser applicationUser, JiraHelper jiraHelper) booleanshouldDisplay(Map<String, Object> context) Methods inherited from class com.atlassian.jira.plugin.webfragment.conditions.AbstractWebCondition
getApplicationUser
-
Constructor Details
-
EntityPropertyEqualToCondition
public EntityPropertyEqualToCondition(com.atlassian.plugin.PluginAccessor pluginAccessor)
-
-
Method Details
-
init
- Specified by:
initin interfacecom.atlassian.plugin.web.Condition- Overrides:
initin classAbstractWebCondition- Throws:
com.atlassian.plugin.PluginParseException
-
shouldDisplay
- Specified by:
shouldDisplayin interfacecom.atlassian.plugin.web.Condition- Overrides:
shouldDisplayin classAbstractWebCondition
-
shouldDisplay
- Specified by:
shouldDisplayin classAbstractWebCondition
-