Hello
I am trying to create a scripted field which will return me a email address. This is so that I can search based on the scripted field for issues created by a particular email domain.
I have tried like this but does not work..
How do I get domain of the reporter.
// Fetch the issue object from the key using the Jira Software API
def issue = get("/rest/agile/1.0/issue/${issue.key}")
.header('Content-Type', 'application/json')
.asObject(Map)
.body
//String reporterEmailAddress = issue.fields.reporter.emailAddress
// Get the Story Points custom field to use in the script
// Get the field ids
def fields = get('/rest/api/2/field')
.asObject(List)
.body as List<Map>
def creatorField = fields.find { it.name == "Creator" }?.id
return creatorField.emailAddress
//return issue.fields.creator.emailAddress
Thanks
Abe
Hello:
Is this for Jira Cloud or Jira Server? The Jira Cloud REST API tends to not return user email addresses, as these are considered private information.
This code returns everything available about the reporter:
def issue = get("/rest/agile/1.0/issue/${issue.key}")
.header('Content-Type', 'application/json')
.asObject(Map)
.body
def reporterProperties = issue.fields.reporter
return reporterProperties
The email address is not an available property. If you're on Jira Server, it's a different story.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.