Last active
September 1, 2022 12:15
-
-
Save lonniev/47400fe04b4d6576eb0b0b1cda50e3c2 to your computer and use it in GitHub Desktop.
Perform a Gremlin Query that retrieves Jira Detail
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reqPriority = { r,e -> reqPost = new URL( "http://some.host.com:9000/external/jira/${r}/artifacts/external/id?includeAttributes=priority" ).openConnection(); reqPost.setRequestProperty( "Content-Type", "application/json" ); reqPost.setRequestProperty( "Accept", "application/json" ); reqPost.setRequestProperty( "Ext-Auth-Token", "SOMETOKEN" ); reqPost.setRequestProperty( "User-Id", "SOMEUSER" ); reqPost.setDoOutput( true ); message = /{ "externalId": "${e}" }/; reqPost.getOutputStream().write( message.getBytes( "UTF-8" ) ); reqPost.getResponseCode(); j = new groovy.json.JsonSlurper().parseText( reqPost.getInputStream().getText() ); j.resources.attributes.priority.get( 'name' ) } | |
g.V().has( 'ArtifactType', 'name', 'Story' ).where( out( 'ownedBy' ).filter{ it -> it.get().value( 'name' ).contains( "Intercax" ) }.out( 'hasType' ).has( 'name', "JIRA Repository Type" ) ).in( 'hasType' ).limit( 1 ).as( 'e' ).out( 'ownedBy' ).out( 'ownedBy' ).as( 'r' ).select( 'r', 'e' ).by( 'sKey' ).by( 'externalId' ).map { it -> reqPriority( it.get().get( 'r' ), it.get().get( 'e' ) ) }.find() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the priority of the first of any curated Jira Stories in the Intercax Jira repository?