Forums

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

Need a groovy script to extract server details from field given in JIRA

R July 4, 2020

I need a groovy script that can extract server details from a field given in JIRA link. Please reply as early as possible. Thanks.

1 answer

0 votes
Nic Brough -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 Leaders.
July 4, 2020

"A field given in a Jira link" does not make sense.  "a jira link" could be anything, and even if we assume it's a link of some sort, you can't link to a field.

I am going to have to assume you mean that you have a Jira field that contains some form of link to a server, and that your question is about getting infrastructure related data from the server.

You can write scripts that will do this, assuming you are using ScriptRunner (most other scripting apps don't have the flexibility for this).

But we can't tell you anything about the script without you telling us what the servers are announcing about themselves, and, more importantly what method you're going to try to read them with.

R July 4, 2020

Hello Nic. 

Thanks for your answer. I need to write a groovy script based on below scenerio.

If Server Group A - a ,b ,c

then Build URLs for group A ( http links )

If Sever Group B - any server besides the one given in server group A

then Build URLs for group B ( http links )

Here the JIRA field details besides server and based on server value given in the field in JIRA i  have to extract those details in my script.

I thought to use if.. else for my scenerio. But i need help like how to extract server details under that if..else.

I hope i am able to explain my query.

R July 4, 2020

Correction : Here JIRA field ( Business Unit ) will have details besides server.

Please try to reply as early as possible. Thanks.

R July 5, 2020

Hi Nic,

Could you please recheck my query.

Thanks..

R July 5, 2020

Could you please provide a sample script based on my query ? Thanks.

Nic Brough -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 Leaders.
July 5, 2020

If then else is the right approach for your logic

You still need to explain what you are trying to use for "extract server details"

R July 5, 2020

Actually that's what I am asking for.. What should I use in my if..else to extract Jira field that contains some form of link to a server. I need to write a groovy script for the same. Please advise if you have any suggestions. Thanks.

Nic Brough -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 Leaders.
July 5, 2020

That's not a question for us.  You need to work out what you want to get from the server and a method for doing it.

I can't tell you if your servers are announcing themselves with bonjour, avahi or any other server info system, or if you're using nagios, zabbix or anything else to monitor or discover them.

Once you have worked out what you want to extract and the appropriate method for it, we can help you run it and get data back from it in the script.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events