|
Class: JIRAClient
Object
|
+--JIRAClient
- Package:
- stx:goodies/webServer
- Category:
- Net-Communication-Rest
- Version:
- rev:
1.30
date: 2023/09/07 20:48:57
- user: stefan
- file: JIRAClient.st directory: goodies/webServer
- module: stx stc-classLibrary: webServer
actually a REST client, but written before we had our RestClient framework.
Therefore, this operates directly via the HTTP interface,
constructing JSON data manually.
copyrightCOPYRIGHT (c) 2018 by eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
accessing
-
invalidResponseError
-
-
invalidTransitionError
-
instance creation
-
new
-
ensure communication sockets are loaded
-
newWithConnectionTo: aURL
-
create a new instance and initialize for the given url
-
newWithConnectionTo: aHost atPort: aPort forUser: aUser withPassword: aPassword
-
create a new instance and initialize for the given hostname and port
-
newWithConnectionTo: aURL forUser: aUser withPassword: aPassword
-
create a new instance and initialize for the given url
accessing
-
apiUri
-
the uri for the latest api
-
apiVersion
-
the version number of the JIRA REST API that is supported
-
maxNumIssuesPerRequest
-
-
maxNumIssuesPerRequest: anInteger
-
-
url
-
the base url of the server
-
url: anURL
-
the base url of the server
authentification
-
login: aUserName password: aPassword
-
no login/logout right now - credentials are send with every request,
OAuth can be implemented later on
-
logout
-
no login/logout right now - credentials are send with every request,
OAuth can be implemented later on
communication
-
delete: aUri
-
delete the specific URI
-
get: aUri
-
get for a specific URI
-
post: aUri with: aDictionaryOrList
-
post the data to a specific URI
-
postProcessHTTPResponse: aResponse
-
try to unwrap JSON structure from response
-
put: aUri with: aDictionaryOrList
-
put the data to a specific URI
protocol
-
addComment: aComment toIssue: aKey
-
add a new comment to an issue, identified by its key
-
createIssueInProject: aProjectKey summary: summary description: description issueType: issueType
-
create an issue
-
createIssueWithFields: fields
-
create an issue.
typical field keys are:
'project', 'summary', 'description', 'issuetype'
-
getCommentsForIssue: aKey
-
return the comments for an issue, identified by its key
-
getConfiguration
-
return the server configuration
-
getFields
-
return a list of available fields and their description
-
getIssue: aKey
-
return an issue identified by its key
-
getIssuesForProject: aKey
-
return all issues for a given project,
identified by the project's key
-
getIssuesForProject: aProjectKey from: startIdx to: endIdx
-
return the issues for a given project in the given range,
identified by the project's key
-
getIssuesFromJqlSearch: aQuery
-
return any result for the given JQL query
-
getProject: aKey
-
return a project identified by its key
-
getProjectComponents: aKey
-
return all project components identified by the projects key
-
getProjects
-
return the list of projects visible for the configurated user
-
getServerInfo
-
return information about the server
-
getTransitionStatesForIssue: aKey
-
-
postTransitionState: aState forIssue: aKey
-
-
postTransitionState: aState forIssue: aKey comment: commentOrNil
-
change the state of a issue
2 - closed
3 - reopened
4 - in progress
5 - resolved
-
postTransitionStateClosedForIssue: aKey
-
set the issue status to closed - 2
-
postTransitionStateClosedForIssue: aKey comment: comment
-
set the issue status to closed - 2
-
postTransitionStateReopenedForIssue: aKey
-
set the issue status to reopened - 3
-
postTransitionStateReopenedForIssue: aKey comment: comment
-
set the issue status to reopened - 3
-
postTransitionStateResolvedForIssue: aKey
-
set the issue status to resolved - 5
-
postTransitionStateResolvedForIssue: aKey comment: comment
-
set the issue status to resolved - 5
-
updateIssue: aKey fields: aDictionaryOrList
-
update multiple fields of an issue, identified by its key
testing
-
serverIsReachable
-
InvalidResponseError
InvalidTransitionError
Demonstrates how to communicate with JIRA via the REST interface.
|instance data|
instance := self newWithConnectionTo:'https://jira.atlassian.com'.
data := instance getIssue:'JRA-9'.
data inspect.
| url:anURL
|instance data|
instance := self newWithConnectionTo:'jira:8080'.
instance login:'EAJP' password:'exept'.
data := instance getProject:'EAJP'.
data inspect.
|
|instance data|
instance := self newWithConnectionTo:'jira:8080'
forUser:'EAJP'
withPassword:'exept'.
data := instance getIssue:'EAJP-1'.
data inspect.
|
|instance data|
instance := self newWithConnectionTo:'jira:8080'
forUser:'EAJP'
withPassword:'exept'.
data := instance getIssuesForProject:'EAJP'.
data inspect.
|
|instance data|
instance := self newWithConnectionTo:'jira:8080'
forUser:'EAJP'
withPassword:'exept'.
data := instance getIssuesForProject:'EAJP' from:1 to:10.
data inspect.
|
|instance data|
instance := self newWithConnectionTo:'jira:8080'
forUser:'EDP'
withPassword:'exept'.
data := instance addComment:'greetings from smalltalk' toIssue:'EDP-1'.
data inspect.
|
|instance dict data|
instance := self newWithConnectionTo:'jira:8080'
forUser:'EDP'
withPassword:'exept'.
dict := Dictionary withKeysAndValues:{'description'. 'described from smalltalk'.}.
data := instance updateIssue:'EDP-1' fields:dict.
data inspect.
|
|instance data|
instance := self newWithConnectionTo:'jira:8080'
forUser:'EDP'
withPassword:'exept'.
data := instance postTransitionStateClosedForIssue:'EDP-1'.
data inspect.
|
|