-
Notifications
You must be signed in to change notification settings - Fork 0
/
HAPI.Groovy
71 lines (60 loc) · 1.65 KB
/
HAPI.Groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
///New Ticket Minuimum Version
Issues.create('DS', 'Task') {
setSummary('My Issue Summary')
setPriority('High')
setDescription('Some description')
}
////New Ticket - Mode details including Custom Field
Issues.create('DS', 'Story') {
setSummary('My Issue Summary from SR Console')
setPriority('High')
setDescription('Some Demo Description')
setAssignee('admin005')
setLabels('Demo')
setDueDate('08/March/23')
setCustomFieldValue('Mac or PC','MAc')
}
///Update Issue
def issue = Issues.getByKey('DS-26')
issue.update {
setSummary('an updated summary')
setDescription('hello *world*')
}
//Append Update
def issue = Issues.getByKey('DS-1')
issue.update {
setDescription {
append ('Text to the End')
}
}
//append('{color:#FF0000}Test{color}')
def issue = Issues.getByKey('DS-1')
issue.update {
setCustomFieldValue('PC equipment List') {
add('Docking Station')
}
}
//Set Due Date 7 days ahead
def issue = Issues.getByKey('DS-1')
issue.update {
setDueDate {
set(get().plusDays(7))
}
}
//// New Project
Projects.create("DPS", "Demo Project Scrum") {
projectLead = 'admin'
projectType = "Scrum"
description = "This is a new project!"
url = "https://ProjectFlow.co.uk"
setDefaultAssigneeToProjectLead()
avatarId = 10001
}
//restrict the comment visibility to a group
Issues.getByKey('DS-1').addComment('My group restricted comment') {
groupRestriction = 'jira-administrators'
}
//restrict the comment visibility to a project role
Issues.getByKey('DS-1').addComment('My role restricted comment') {
projectRoleRestriction = 'Administrators'
}