Hi,
We are working on integrating Jira with Workday. We have got Client ID, Key and Authorization url from Workday and need to implement OAuth authentication using Groovy.
Can you please share the code to setup Oauth2.0 authentication by using Groovy? Or is there any other method from Jira we can use to implement Oauth?
Regards,
Raj
Hi @raj-kumar2
Can't you just add Workday as a generic application link with OAuth in the JIra Application Links Configuration?
Then you can just leverage the application link object in groovy.
Something along these lines:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.applinks.JiraApplicationLinkService
import com.atlassian.sal.api.net.Response
import com.atlassian.sal.api.net.ResponseException
import com.atlassian.sal.api.net.ResponseHandler
import com.atlassian.sal.api.net.Request.MethodType
def appLinkService = ComponentAccessor.getComponent(JiraApplicationLinkService.class)
def appLink = appLinkService.getApplicationLinks().find{it.name == 'Workday'}
def appLinkRequestFactory = appLink.createAuthenticatedRequestFactory()
def request = appLinkRequestFactory.createRequest(MethodType.POST, 'workday/endpoint')
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.