30
우우 우우 우우 우우우우 우우우우우우 우우 - Build Atlassian add-ons - 우우우 우우 , 우우우우우우우

Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

  • Upload
    osc-osc

  • View
    1.300

  • Download
    5

Embed Size (px)

Citation preview

Page 1: Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

우리 회사 업무 시스템과 아틀라시안의 만남- Build Atlassian add-ons -

권봉진 부장 , 오픈소스컨설팅

Page 2: Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

2

목차1. Atlassian add-ons2. Deveolper Environment 3. Atlassian Plugin SDK4. Plugin Development Steps5. Example #1 - Helloworld Plugin6. Example #2 - Telegram Plugin7. REST APIs & Example

예제소스 : https://github.com/OpenSourceConsulting/atlassian-apps

Page 3: Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

3

1. Atlassian add-ons

Atlassian add-ons

- Plugin add-ons- Atlassian Connect add-ons

Integration

- REST APIs 제공

Page 4: Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

4

1. Atlassian add-ons

CustomLink Menu 추가

Custom 메뉴 & 화면 추가

내부 데이터 및 변경 event 를 외부 시스템으로 전송

Atlassian 내부 데이터를업무시스템에 표시

업무시스템에서Jira 이슈 생성

업무시스템에서Jira 계정 생성 / 조회

Pluginadd-ons

Connectadd-ons

REST APIs

Use Case

Atlassian Marketplace

Page 5: Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

5

2. Developer Environment

Java SDK + Atlassian Plugin SDK + IDE (Eclipse)ver 1.7 ver 6.1.0

Lunar

Plugin project 생성 Jira 자동 설치및 실행

Plugin 자동 설치

참고 : https://developer.atlassian.com/docs/getting-started/set-up-the-atlassian-plugin-sdk-and-build-a-project

Page 6: Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

6

2. Developer Environment - Set up the JDK

1. Download and Install JDK2. JAVA_HOME 환경변수에 JDK 설치경로 등록3. PATH 환경변수에 JAVA_HOME/bin 경로 추가

Page 7: Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

7

2. Developer Environment - Set up the Atlassian Plugin SDK

1. Download : https://marketplace.atlassian.com/plugins/atlassian-plugin-sdk-windows/server/overview2. Run the installer EXE3. 설치완료후 Window 재시작4. 윈도우 cmd 창을 열고 ‘ atlas-version’ 명령으로 아래와 같이 출력되면 정상임 .

Page 8: Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

8

2. Developer Environment - Set up the Eclipse

1. Download and Install Eclipse IDE for Java EE (Lunar)2. JDK 설정 .

3. Maven 설정

Page 9: Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

9

3. Atlassian Plugin SDK

참고 : https://developer.atlassian.com/docs/developer-tools/working-with-the-sdk/command-reference

Page 10: Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

10

3. Atlassian Plugin SDK– Commands

SDK Commands Description

atlas-create-jira-plugin jira plugin project 를 생성한다 .

atlas-mvn eclipse:eclipse eclipse project meta data 생성 .

atlas-create-jira-plugin-module

jira plugin module 을 추가한다 .

atlas-run jira plugin project 폴더 안에서 실행되어서 plugin build 에서부터 plugin 이 자동 설치된 jira 를 설치 및 실행해준다 .

atlas-run-standalone atlassian 제품 를 자동 설치 및 실행해준다 .

Page 11: Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

11

3. Atlassian Plugin SDK– Create Plugin Project

입력항목

Page 12: Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

12

3. Atlassian Plugin SDK - Plugin Modules

• Plugin add-on 은 반드시 하나 이상의 plugin module 을 포함해야 한다 .• atlas-create-<app>-plugin-module or annotation 으로 추가

Page 13: Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

13

• atlas-create-jira-plugin

• atlas-mvn eclipse:eclipse• delete .classpath file• Import Project• convert Maven Project

• atlas-create-jira-plugin-module • or using annotation

• atlas-run or atlas-package• or maven build on Eclipse

• atlas-run ( on Local Jira)• or add add-ons to Jira (file upload)

4. Plugin Development Steps

Project 생성

Eclipse import

Plugin module 추가 및기능 구현

Build

Plugin 설치

Page 14: Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

14

4. Plugin Development Steps – Step #2 : Eclipse import

atlas-mvn eclipse:eclipse- Eclipse 에서 인식할수 있는 eclipse project metadata 를 생성해준다 .- eclipse java project 로 생성됨 .

.classpath 파일 삭제- old version eclipse 기반 .classpath file 삭제 .

Convert to Maven Project

Import Project

Page 15: Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

15

Example #1 - HelloWorld Plugin

동영상 시연- JIRA 에 Custom Menu 생성하기 -

https://youtu.be/fgdJ1U52Ypc

Page 17: Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

17

Example #2 -Telegram 연동 Plugin

Project 생성

Eclipse import

Plugin module 추가 및기능 구현

Build

Plugin 설치

atlas-create-jira-plugin

Page 18: Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

18

Example #2 -Telegram 연동 Plugin

Project 생성

Eclipse import

Plugin module 추가 및기능 구현

Build

Plugin 설치

delete.classpath

Page 19: Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

19

Example #2 -Telegram 연동 Plugin : annotation 기반

Project 생성

Eclipse import

Plugin module 추가 및기능 구현

Build

Plugin 설치

atlas-create-jira-plugin-module 대신 annotation 사용

Page 20: Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

20

Example #2 -Telegram 연동 Plugin : command 기반

Project 생성

Eclipse import

Plugin module 추가 및기능 구현

Build

Plugin 설치

atlas-create-jira-plugin-module 사용

src/main/resources/atlassian-plugin.xml

@ExportAsService@Named@ComponentImport@Inject사용안함

Page 21: Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

21

Example #2 -Telegram 연동 Plugin

Project 생성

Eclipse import

Plugin module 추가 및기능 구현

Build

Plugin 설치

동영상 시연https://youtu.be/BEEBblaYyrM

Page 22: Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

22

Atlassian REST APIs

REST APIs

http

사내 업무시스템

• JIRA REST APIs• Confluence REST APIs• FishEye/Crucible REST

APIs• Bamboo REST APIs• Stash REST APIs• Crowd REST APIs

참고 : https://developer.atlassian.com/docs/atlassian-platform-common-components/rest-api-development

Page 23: Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

23

REST API Browser

참고 : https://developer.atlassian.com/docs/developer-tools/using-the-rest-api-browser

administration console > System > ADVANCED > REST API Browser

Page 24: Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

24

Atlassian REST APIs - Authentication

• Basic Authentication (JIRA 5.0 이상 )https://en.wikipedia.org/wiki/Basic_access_authentication https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-basic-authentication

• OAuth (JIRA 5.0 이상 )https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-oauth-authentication

• Session Authentication

Example Basic Authentication

Page 26: Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

26

Atlassian REST APIs - Example

• 이슈 목록 조회하기• REST API : jira/rest/api/2/search

• request parameter samplejql=assignee=fred

Apache HttpComponents

Page 27: Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

27

Atlassian REST APIs - Example

• 이슈 생성하기• REST API : jira/rest/api/2/issue

• rquest parameter sample

Page 28: Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

28

Atlassian REST APIs - Example

• Basic Authentication Logic

Authentication .

Page 29: Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

29

Atlassian REST APIs - Example

동영상 시연https://youtu.be/vAwUohBgF3s

Page 30: Atlassian JIRA Plugin 및 REST API를 이용한 기능 확장

30

감사합니다 !!