-
Notifications
You must be signed in to change notification settings - Fork 25
/
test_organization.sh
executable file
·91 lines (80 loc) · 2.35 KB
/
test_organization.sh
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/bin/bash
export DEBUG_COMMANDS="false"
export DEBUG_LOG="true"
# global settings
ENTRYPOINT_MODE=organization
ORG_OR_USER_NAME=computingoverload
PROJECT_ID=1
RESOURCE_NODE_ID=I_kwDOGoqhi85BTjcx
ENTRYPOINT_SCRIPT=./entrypoint.sh
# change the status of a pr or issue
ENTRYPOINT_TYPE=status
RESOURCE_NODE_VALUE=Done
$ENTRYPOINT_SCRIPT "$ENTRYPOINT_MODE" "$ENTRYPOINT_TYPE" "$ORG_OR_USER_NAME" "$PROJECT_ID" "$RESOURCE_NODE_ID" "$RESOURCE_NODE_VALUE"
# change the status of a pr or issue to ''
#echo "===== change status"
#$ENTRYPOINT_SCRIPT "$ENTRYPOINT_MODE" "$ENTRYPOINT_TYPE" "$ORG_OR_USER_NAME" "$PROJECT_ID" "$RESOURCE_NODE_ID"
# change the value of custom fields
date=$(date +"%Y-%m-%d")
uuid1=$(uuidgen)
uuid2=$(uuidgen)
random_number=$(( $RANDOM % 10 )).$(( $RANDOM % 10 ))
custom_fields="[
{
\"name\": \"Single Select\",
\"type\": \"single_select\",
\"value\": \"Option 2\"
},
{
\"name\": \"Priority\",
\"type\": \"text\",
\"value\": \"$uuid1\"
},
{
\"name\": \"Iteration\",
\"type\": \"iteration\",
\"value\": \"Iteration 12\"
},
{
\"name\": \"Iteration\",
\"type\": \"iteration\",
\"value\": \"@current\"
},
{
\"name\": \"Iteration\",
\"type\": \"iteration\",
\"value\": \"@next\"
},
{
\"name\": \"Date\",
\"type\": \"date\",
\"value\": \"$date\"
},
{
\"name\": \"Number\",
\"type\": \"number\",
\"value\": \"$random_number\"
}
]"
echo "===== change custom fields"
ENTRYPOINT_TYPE=custom_field
RESOURCE_NODE_VALUE=$custom_fields
$ENTRYPOINT_SCRIPT "$ENTRYPOINT_MODE" "$ENTRYPOINT_TYPE" "$ORG_OR_USER_NAME" "$PROJECT_ID" "$RESOURCE_NODE_ID" "$RESOURCE_NODE_VALUE"
custom_fields="[
{
\"name\": \"Iteration\",
\"type\": \"iteration\",
\"value\": \"@next\"
}
]"
RESOURCE_NODE_VALUE=$custom_fields
$ENTRYPOINT_SCRIPT "$ENTRYPOINT_MODE" "$ENTRYPOINT_TYPE" "$ORG_OR_USER_NAME" "$PROJECT_ID" "$RESOURCE_NODE_ID" "$RESOURCE_NODE_VALUE"
custom_fields="[
{
\"name\": \"Iteration\",
\"type\": \"iteration\",
\"value\": \"@current\"
}
]"
RESOURCE_NODE_VALUE=$custom_fields
$ENTRYPOINT_SCRIPT "$ENTRYPOINT_MODE" "$ENTRYPOINT_TYPE" "$ORG_OR_USER_NAME" "$PROJECT_ID" "$RESOURCE_NODE_ID" "$RESOURCE_NODE_VALUE"