It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

scriptrunner script to display external DB value Edited

Hello,

    I am exploring a way to read from an external DB, locate a value that pertains to a name we store in the summary field.  For instance my MS SQL query and groovy would look close to this:

DatabaseUtil.withSql('fuel') { sql ->
sql.rows('SELECT [VEHICLEID] , [CURRODOM] FROM [FUELMASTER].[dbo].[VehicleCK] where [VEHICLEID] like '%{issue.summary}')
}

Then I would like to write the CURRODOM value to a custom field.

I can get data returned in general that looks like this (if I remove the where clause):

[[VEHICLEID:000000G1, CURRODOM:135874], [VEHICLEID:000000G2, CURRODOM:064523], [VEHICLEID:000000H9, CURRODOM:679841]......

I would like the CURRODOM number formatted to only be displayed as a number like 135874 in the custom field.

 

How can this be accomplished?

 

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.11
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Announcing the winners of Codegeist 2020

Hey team! We brought back Codegeist in a big way this year, and today, we’re thrilled to announce the winners. 🎉 Thank you to everyone who participated in Codegeist 2020. This year, we go...

247 views 5 13
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you