Dear all,
I have the following script which is store in a file named SlackUser.groovy
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.comments.CommentManager
import groovy.json.*
import groovyx.net.*
import groovyx.net.http.*
import static groovy.json.JsonOutput.*
import static groovyx.net.http.ContentType.*
import static groovyx.net.http.Method.*
class SlackUser{
Issue refIssue
//Field defienition constant to be read from issue
String emailFieldName="Email Address" //10523
String emailField=""
public String emailFieldValue=""
CommentManager commentMgr=ComponentAccessor.getCommentManager()
SlackUser(Issue issue)
{
refIssue=issue
def customFieldMgr=ComponentAccessor.getCustomFieldManager()
emailField =customFieldMgr.getCustomFieldObjects().findByName(emailFieldName)
emailFieldValue=refIssue.getCustomFieldValue(emailField) <<< error
}
}
Then I am calling that script from my Script console as below :
Issue refIssue=ComponentAccessor.getIssueManager().getIssueObject("TSD-2102")
SlackUser slk=new SlackUser(refIssue)
When the SlackUser object is created, I get a wierd error in the BOLD line above saying :
"groovy.lang.MissingMethodException: No signature of method: com.atlassian.jira.issue.IssueImpl.getCustomFieldValue() is applicable for argument types: (java.lang.String) values: [Email Address] Possible solutions: getCustomFieldValue(com.atlassian.jira.issue.fields.CustomField), setCustomFieldValue(com.atlassian.jira.issue.fields.CustomField, java.lang.Object) at ServiceRequest.SlackUser.<init>(SlackUser.groovy:53) at Script564.run(Script564.groovy:71)"
What is wrong and how to solve that error ?
regards
Yes.
But you will need to remove access for all users and then let people back in, specifically not letting this one group of users not have access to the rest of the projects.
This was asked yesterday a https://answers.atlassian.com/questions/82994/how-do-i-restrict-user-access-to-a-project
(and the day before, and the day before, and the day before. I'm not pointing at you for not looking though, the search in "Answers" doesn't work at the best of times, and we desperately need a set of stock answers we can point at for repeated questions too)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.