@PublicApi public class EntityPropertyEqualToCondition extends AbstractWebCondition
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:
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.
Constructor and Description |
---|
EntityPropertyEqualToCondition(com.atlassian.plugin.PluginAccessor pluginAccessor) |
Modifier and Type | Method and Description |
---|---|
void |
init(Map<String,String> params) |
boolean |
shouldDisplay(ApplicationUser applicationUser,
JiraHelper jiraHelper) |
boolean |
shouldDisplay(Map<String,Object> context) |
public EntityPropertyEqualToCondition(com.atlassian.plugin.PluginAccessor pluginAccessor)
public void init(Map<String,String> params) throws com.atlassian.plugin.PluginParseException
init
in interface com.atlassian.plugin.web.Condition
init
in class AbstractWebCondition
com.atlassian.plugin.PluginParseException
public boolean shouldDisplay(Map<String,Object> context)
shouldDisplay
in interface com.atlassian.plugin.web.Condition
shouldDisplay
in class AbstractWebCondition
public boolean shouldDisplay(ApplicationUser applicationUser, JiraHelper jiraHelper)
shouldDisplay
in class AbstractWebCondition
Copyright © 2002-2019 Atlassian. All Rights Reserved.