Last active
August 29, 2015 14:20
-
-
Save xlcommunity/00f654aa9d759e9126ba to your computer and use it in GitHub Desktop.
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
# 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 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
<!-- | |
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