Skip to content

Commit

Permalink
Replace JIRA client
Browse files Browse the repository at this point in the history
Removes the unmaintained Atlassian-provided JIRA client with undesirable
dependencies with a hand-written client.
  • Loading branch information
apmasell authored and avarsava committed Feb 9, 2024
1 parent 805bf7a commit fe5d0fb
Show file tree
Hide file tree
Showing 27 changed files with 1,222 additions and 806 deletions.
1 change: 1 addition & 0 deletions changes/change_jira.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Merge JIRA `open_ticket` and `resolve_ticket` into a single `issue` action
42 changes: 17 additions & 25 deletions plugin-jira/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,39 @@
application.
The JIRA plugin for Shesmu can be used to:

- open and close tickets
- search for tickets matching a keyword
- count the number of tickets matching a keyword
- open and close issues
- search for issues matching a JQL query

To set up a JIRA integration, create a file ending in `.jira` as follows:

{
"closeActions": [
"Close Issue",
"Resolve Issue"
],
"closedStatues": [
"authentication": null,
"closedStatuses": [
"CLOSED",
"RESOLVED"
],
"defaultFieldValues": {},
"issueType": "Bug",
"passwordFile": "/path/to/jira/password",
"projectKey": "PK",
"reopenActions": [
"Reopen Issue"
],
"searches": [],
"url": "https://jira.example.com",
"user": "ticketbot"
"version": "V2"
}

`closeActions` are the names of the buttons (yes, really) in JIRA that close a
ticket. `reopenActions` are the names of the buttons in JIRA that reopen a
closed ticket. `closedStatuses` are the statuses of tickets that should be
considered closed. Any other status is considered open.
Shesmu supports `"V2"` (datacenter) and `"V3"` (cloud) API versions.

`closedStatuses` are the statuses of issues that should be considered closed.
Any other status is considered open.

The `url` defines the JIRA server that will be used and `user` is the name of
the user to authenticate as and `passwordFile` is the path of a text file
containing the passsword for this user. One configuration file is needed for
each JIRA project, which is specified in the `projectKey` property. Normally,
the `closeActions`, `reopenActions`, and `closedStatuses` will be the same for
most projects on a JIRA server, but they need not be, hence the need for
separate configuration files.
The `url` defines the JIRA server that will be used and `authentication` is the
authentication mechanim to use. It is the same as the authentication
configuration described for [input definitions](README.md). One configuration
file is needed for each JIRA project, which is specified in the `projectKey`
property. Normally, the `closeActions`, `reopenActions`, and `closedStatuses`
will be the same for most projects on a JIRA server, but they need not be,
hence the need for separate configuration files.

Shesmu needs to create and reopen tickets, but it can only do so if there are
Shesmu needs to create and reopen issues, but it can only do so if there are
either no mandatory fields to fill in beyond the summary and description or it
has the required fields. `defaultFieldValues` provides values to use on
required fields. Fields which are not required are not sent even if a default
Expand Down
104 changes: 0 additions & 104 deletions plugin-jira/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,47 +13,12 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>atlassian-public</id>
<url>https://packages.atlassian.com/content/repositories/atlassian-public/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
<releases>
<enabled>true</enabled>
<checksumPolicy>warn</checksumPolicy>
</releases>
</repository>
<repository>
<id>atlassian-repo</id>
<name>atlassian public repo</name>
<url>https://packages.atlassian.com/mvn/maven-external/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>ca.on.oicr.gsi</groupId>
<artifactId>shesmu-pluginapi</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-rest-java-client-api</artifactId>
<version>5.2.4</version>
</dependency>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-rest-java-client-core</artifactId>
<version>5.2.4</version>
</dependency>
<dependency>
<groupId>io.atlassian.fugue</groupId>
<artifactId>fugue</artifactId>
<version>5.0.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
Expand Down Expand Up @@ -82,75 +47,6 @@
<target>17</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<pattern>com.google</pattern>
<shadedPattern>com.atlassian.com.google</shadedPattern>
</relocation>
<relocation>
<pattern>javax.ws</pattern>
<shadedPattern>com.atlassian.javax.ws</shadedPattern>
</relocation>
<relocation>
<pattern>com.sun.ws</pattern>
<shadedPattern>com.atlassian.com.sun.ws</shadedPattern>
</relocation>
<relocation>
<pattern>com.sun.jersey</pattern>
<shadedPattern>com.atlassian.com.sun.jersey</shadedPattern>
</relocation>
<relocation>
<pattern>org.joda</pattern>
<shadedPattern>com.atlassian.org.joda</shadedPattern>
</relocation>
<relocation>
<pattern>javax.annotation</pattern>
<shadedPattern>com.atlassian.javax.annotation</shadedPattern>
</relocation>
<relocation>
<pattern>com.sun.xml</pattern>
<shadedPattern>com.atlassian.com.sun.xml</shadedPattern>
</relocation>
<relocation>
<pattern>javax.xml</pattern>
<shadedPattern>com.atlassian.javax.xml</shadedPattern>
</relocation>
<relocation>
<pattern>javax.activation</pattern>
<shadedPattern>com.atlassian.javax.activation</shadedPattern>
</relocation>
<relocation>
<pattern>com.sun.activation</pattern>
<shadedPattern>com.atlassian.com.sun.activation</shadedPattern>
</relocation>
<relocation>
<pattern>org.springframework</pattern>
<shadedPattern>com.atlassian.org.springframework</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>*:*:*:*</artifact>
<excludes>
<exclude>log4j.properties</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Loading

0 comments on commit fe5d0fb

Please sign in to comment.