Reputation: 53
New to velocity and need some help. I'm getting a field value:
#set($value2 = $customFieldManager.getCustomFieldObject("customfield_10010").getValue($issue))
But now want to check if $value2
contains a certain string, for example abc
.
How do I do this?
Upvotes: 0
Views: 3522
Reputation: 21
We can use contains
to check value is in array as well
#if( $arrayName.contains($value) )
<p>$value</p>
#end
Upvotes: 1
Reputation: 965
I would use
#if($value2.contains("abc"))
<p>display something, for example</p>
#end
just like you would do in java;
Regards
Upvotes: 1