Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

variable CustomFieldManager mask a binding variable of the same name

ghalia sidi amemou
March 31, 2023

def customFieldManager = ComponentAccessor.getCustomFieldManager()
def emailField = customFieldManager.getCustomFieldObjectByName("Email du client")
def clientEmail = issue.getCustomFieldValue(emailField)

1 answer

Suggest an answer

Log in or Sign up to answer
2 votes
Daniel Yelamos [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
October 3, 2017

Hello Roberto.

If you look further down the article, you will see that the user was wrong on his first approach, and later on, was able to work it out with this:

import groovyx.net.http.HTTPBuilder
import static groovyx.net.http.ContentType.*
import groovyx.net.http.ContentType
import static groovyx.net.http.Method.*
import groovy.json.JsonSlurper
import net.sf.json.groovy.JsonSlurper

def http = new HTTPBuilder('http://IP/authentication')
http.request(POST) {
    requestContentType = ContentType.JSON
    body =  [username: 'USERNAME', password: 'PASSWORD']

        response.success = { resp, JSON ->

  return JSON
            
    }
    
        response.failure = { resp ->
        return "Request failed with status ${resp.status}"
            
        

Could you give that a try and letme know if it works?

Cheers

DYelamos

Deleted user
May 28, 2019

syntax errors

Like Deleted user likes this
TAGS
AUG Leaders

Atlassian Community Events