I have a post-function function that depends on a value of a field of an issue. How do I get a list of the possible. valid values that can be conditionally tested? For example, I need the correct syntax to test the project key. Where do you find the correct syntax for the variable to be tested (e.g. issue.projectkey.name == 'ABC')?
Looking for a list or where to view code like 'issue.projectkey.name'.
Cheers!
Hi,
Your code looks like groovy. If you could tell us the name for the post-function we could be sure. Assuming it is groovy then it would be:
issue.projectObject.name == "ABC"
On the more general subject of "how", my advice is at this answer.
Also explained in that is how project/projectObject are methods.
Oh, I see you asked that other question too. I guess my advice was not helpful :-(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your advice is always helpful.
Just trying to get a better handle on creating a debug/test enironment for jira so I can step through the code and see this all for myself.
I looked at MutableIssue and see the methods for the class issue. But still not comfortable with how you got the
.projectObject.name
since I do not see that anywhere on the MutableIssue link?
Cheers!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK so... issue.projectObject.name is the same as issue.getProjectObject().getName() in java...
getProjectObject() is on MutableIssue (see javadoc link) but it's inherited from Issue.
getName() is a method of Project (which is what is returned by getProjectObject()/projectObject).
cheers, jamie
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's quite difficult to answer because we can't be sure what objects you've got, and your language doesn't look like Java (which is all I'm familiar with writing in plugins)
However, the most obvious case for a post-function (and what I'd do) is that your "issue" is a "MutableIssue" object, or possibly just an "Issue" (in either case getting data out of them is the same) - see http://docs.atlassian.com/software/jira/docs/api/latest/com/atlassian/jira/issue/Issue.html for the details of why you probably want:
issue.getProjectObject().getKey() will give you a raw string of ABC. Of course, in Java, you probably want to use .equals rather than == as well.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was looking for the syntax for the condition in the post-function of a workflow. At that point the issue values are already available within jira in the MutableIssue object. Just need to know the variable and syntax to use in the condition.
Can't determine if it is issue.project.key == 'ABC' or issue.key == 'ABC' or whatever.
Do you know where that information is stored? The MutableIssue link gives me the methods but not the object variables.
Thanks for your prompt response -- I appreciate you help.
Cheers!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just to elaborate, I am trying to determine how to set the condition on a post-function function. Using the example above -- project key -- would the proper condition syntax be:
isssue.projectKey.name == 'ABC'
or
issue.key == 'ABC'
or
issue.projectKey == 'ABC'
How can one see which is the proper syntax for the condition?
Cheers!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.