|
Class: JIRAClient
Object
|
+--JIRAClient
- Package:
- stx:goodies/webServer
- Category:
- Net-Communication-Rest
- Version:
- rev:
1.21
date: 2019/05/29 21:57:34
- user: cg
- 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.
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
-
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.
|
|