Can anybody help me?
I guess I'm commenting some silly mistake
I have more than 60 security level created (one for each cost center)
I'm trying to create a post-function script that will fill the security level according to the cost center informed.
But I can not understand why the issue.setSecurityLevelId (10501) gets highlighted saying "Can not find matching method"
import com.atlassian.jira.component.ComponentAccessor
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def CC = customFieldManager.getCustomFieldObject("customfield_16029")
def CC_value = issue.getCustomFieldValue(CC).toString()
if (CC_value == 'XYZ')
{
issue.setSecurityLevelId(10501)
}
Hi @Dante Labate,
If you have Script Runner, what about doing in that way;
sorry for the delay to reply..
I can not do the way you indicated because the security level will be based on the cost center of the person who is opening the issue.
so I have to do some checks on the post-function to know what the correct cost center is.
if it were to do the form suggested, it would have to have several post-function validating whether or not it is in that cost center (we have 70 different cost center).
My code works, I was just curious why the red mark (as if it was wrong).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ahh got it @Dante Labate. There is nothing wrong with your code.
The reason for red mark is; script doesn't recognize the issue so it doesn't find matching method for issue.setSecurityLevelId(). (but gets issue object in post-function as expected)
Ex; if you add the following line at the beginning, you will not see that error. But do not of course, it just for one example issue :)
def issue = ComponentAccessor.getIssueManager().getIssueObject("ABC-1");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ahhh .. that makes perfect sense ..
Thank you for answering my question.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.