Forums

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

Jira Rest Java Client compatible with Adaptavist?

Tahir Idrees
August 1, 2018

Hi, we have started using Adaptavist as our test management tool. We would like to integrate this plugin with our Automation suite which is written in Java. Is the jira rest java client compatible with this API?

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer
1 vote
Answer accepted
Joanna Choules
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.
February 23, 2021

Hi Faisal,

You won't find the user-agent information in the URL, but it is available in the HTTP request (when that is present):

import webwork.action.ActionContext

def userAgent = ActionContext.request?.getHeader("User-Agent")

Note that this will give you a string, which you will then have to parse yourself if you want to extract any specific data from it. If this code runs outside of the context of an HTTP request, userAgent will be null.

 

Joanna Choules, Adaptavist Product Support

acc1211
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.
February 23, 2021

Thanks @Joanna Choules  for your Reply . Currently i am running the jira instance on my personal Pc , So is it possible to get the HTTP request info .

 

I am new to the development side of it so can you help me out here . 

Some thing which will help me get the HTTP Request info 

As you said currently i am getting null

 

Thanks in advance 

Joanna Choules
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.
February 24, 2021

Hi Faisal,

Jira still uses HTTP even if you're running it locally, so that shouldn't be a problem.

What is the context in which you're trying to get this data? I tried my code inside a script field, and it worked the way I expected it to. Are you getting null with your code, with mine, or with both?

Joanna

acc1211
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.
February 25, 2021

Thanks for the update 

@Joanna Choules 

Currently i have created scripted field which returns free  text searcher as the value for the field and i am running the code  on a particular issue and there  i am getting null for the user agent .  so i was thinking that i need to capture the HTTP request through something . Looks like there is something which i am not understanding or missing can you please help me out here 

1234.PNG

Capture1.PNG

Joanna Choules
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.
February 25, 2021

Hi Faisal,

I just tested it locally, and it appears that this code doesn't work in Preview mode, but when you view an issue normally, it should show you the user agent string for the browser you're using. Could you try that and let me know? Do bear in mind, of course, that the value you want the field to have should be the return value of the script: if you end your code with a logging statement, the implicit return value will be null, and the field will have no value.

Joanna

acc1211
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.
February 28, 2021

Thanks @Joanna Choules . I have got the output as required and once again thanks for the help . 

 

i am getting the info for the firefox browser and also the chrome browser but when i use edge browser the user agent value is coming out as chrome browser is there any problem with the value set for it @Joanna Choules  can you please help 

TAGS
AUG Leaders

Atlassian Community Events