Quantcast
Channel: How to set the description of a JIRA Workflow Validator? - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Answer by Jonathan.Taylor for How to set the description of a JIRA Workflow Validator?

$
0
0

It turns out, I had copied/pasted a piece of code from my workflow condition that needed to be tweaked for a workflow validator. I was trying to cast to a ConditionDescriptor when I should have been casting to a ValidatorDescriptor:

Bad:

if (!(descriptor instanceof ConditionDescriptor)) {
          throw new IllegalArgumentException("Descriptor must be a ConditionDescriptor.");
        }

        ConditionDescriptor conditionDescriptor = (ConditionDescriptor) descriptor;

Good:

if (!(descriptor instanceof ValidatorDescriptor)) {
            throw new IllegalArgumentException("Descriptor must be a ValidatorDescriptor.");
        }

        ValidatorDescriptor validatorDescriptor = (ValidatorDescriptor) descriptor;

Pretty neat that instead of completely breaking my plugin, it ended up displaying a different description altogether. ;)


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>