Skip to content

Instantly share code, notes, and snippets.

@xlcommunity
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xlcommunity/00f654aa9d759e9126ba to your computer and use it in GitHub Desktop.
Save xlcommunity/00f654aa9d759e9126ba to your computer and use it in GitHub Desktop.
# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS
# FOR A PARTICULAR PURPOSE. THIS CODE AND INFORMATION ARE NOT SUPPORTED BY XEBIALABS.
import sys
if jiraServer is None:
print "No server provided."
sys.exit(1)
jiraURL = jiraServer['url']
if jiraURL.endswith('/'):
jiraURL = jiraURL[:len(jiraURL)-1]
if not sampleIssueId:
print 'ERROR: Please provide the ID of sample issue to check connectivity.'
sys.exit(1)
request = HttpRequest(jiraServer, username, password)
response = request.get("/rest/api/2/issue/%s.json" % (sampleIssueId), contentType = 'application/json')
if response.isSuccessful():
print "Successfully retrieved sample issue from JIRA server %s" % (jiraURL)
else:
print 'ERROR: Unable to retrieve sample issue from the server'
response.errorDump()
sys.exit(1)
<!--
THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS
FOR A PARTICULAR PURPOSE. THIS CODE AND INFORMATION ARE NOT SUPPORTED BY XEBIALABS.
-->
<type type="my.JiraConnectivityCheckTask" extends="xlrelease.PythonScript">
<property name="jiraServer" category="input" label="Server" referenced-type="jira.Server" kind="ci"/>
<property name="username" category="input"/>
<property name="password" password="true" category="input"/>
<property name="sampleIssueId" category="input" default="${sampleIssueId}" />
</type>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment