I'm trying the following imports in a Profields custom script field.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.config.properties.APKeys
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
import groovyx.net.http.RESTClient
import org.apache.http.HttpRequest
import org.apache.http.HttpRequestInterceptor
import groovyx.net.http.HttpResponseException
import org.apache.http.HttpResponse
import org.apache.http.protocol.HttpContext
import groovyx.net.http.ContentType.JSON
import groovyx.net.http.Method.GET
import groovyx.net.http.Method.PUT
This works in ScriptRunner but in Profields/Project Navigator it generates the following errors.
[c.d.j.p.i.value.service.GroovyValueService] Error while getting the Script field value: startup failed:
Script1.groovy: 5: unable to resolve class groovyx.net.http.RESTClient
@ line 5, column 1.
import groovyx.net.http.RESTClient
Script1.groovy: 8: unable to resolve class groovyx.net.http.HttpResponseException
@ line 8, column 1.
import groovyx.net.http.HttpResponseException
Script1.groovy: 11: unable to resolve class groovyx.net.http.ContentType.JSON
@ line 11, column 1.
import groovyx.net.http.ContentType.JSON
Script1.groovy: 13: unable to resolve class groovyx.net.http.Method.PUT
@ line 13, column 1.
import groovyx.net.http.Method.PUT
Script1.groovy: 12: unable to resolve class groovyx.net.http.Method.GET
@ line 12, column 1.
import groovyx.net.http.Method.GET
Script1.groovy: 3: unable to resolve class com.onresolve.jira.groovy.user.FieldBehaviours
@ line 3, column 1.
import com.onresolve.jira.groovy.user.FieldBehaviours
6 errors
I probably don't need the com.onresolve one but definitely need RESTClient as I'm making a post request to Tempo timesheets to populate a custom field. Anyone know how to accomplish this?