Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
AutoJira
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile
AutoJira
Commits
c07833d2
Commit
c07833d2
authored
Mar 27, 2019
by
汪洋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
针对更美与alpha两个项目的子任务调整
parent
cfbc45c8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
6 deletions
+17
-6
Breakpoints_v2.xcbkptlist
...wangyang.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
+1
-1
Page.swift
AutoJira/Page.swift
+2
-2
Story.swift
AutoJira/Story.swift
+3
-2
ViewController.swift
AutoJira/ViewController.swift
+11
-1
No files found.
AutoJira.xcworkspace/xcuserdata/wangyang.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
View file @
c07833d2
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
ignoreCount =
"0"
ignoreCount =
"0"
continueAfterRunningActions =
"No"
continueAfterRunningActions =
"No"
filePath =
"AutoJira/Page.swift"
filePath =
"AutoJira/Page.swift"
timestampString =
"57
4140957.231858
"
timestampString =
"57
5300302.606153
"
startingColumnNumber =
"9223372036854775807"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"89"
startingLineNumber =
"89"
...
...
AutoJira/Page.swift
View file @
c07833d2
...
@@ -37,8 +37,8 @@ class Page: NSObject {
...
@@ -37,8 +37,8 @@ class Page: NSObject {
html
=
loadHTML
()
html
=
loadHTML
()
// 这个逻辑是模仿wiki页面中的javasript中的已有的逻辑
// 这个逻辑是模仿wiki页面中的javasript中的已有的逻辑
if
let
meta
=
html
?
.
at_xpath
(
"//meta[@name='confluence-request-time']"
)
{
if
let
meta
=
html
?
.
at_xpath
(
"//meta[@name='confluence-request-time']"
)
,
let
time
=
meta
[
"content"
]
{
lastFetchTime
=
meta
[
"content"
]
!
lastFetchTime
=
String
(
time
)
}
else
{
}
else
{
lastFetchTime
=
String
(
Int
(
Date
()
.
timeIntervalSince1970
*
1000
))
lastFetchTime
=
String
(
Int
(
Date
()
.
timeIntervalSince1970
*
1000
))
}
}
...
...
AutoJira/Story.swift
View file @
c07833d2
...
@@ -66,7 +66,7 @@ class Story: NSObject {
...
@@ -66,7 +66,7 @@ class Story: NSObject {
var
request
=
URLRequest
(
url
:
url
)
var
request
=
URLRequest
(
url
:
url
)
request
.
httpMethod
=
"POST"
request
.
httpMethod
=
"POST"
request
.
setValue
(
"application/json"
,
forHTTPHeaderField
:
"Content-Type"
)
request
.
setValue
(
"application/json"
,
forHTTPHeaderField
:
"Content-Type"
)
let
bodyString
=
"{
\"
pageId
\"
:
\"\(
pageId
)\"
,
\"
selectedText
\"
:
\"
项目背景
\"
,
\"
index
\"
:0,
\"
numMatches
\"
:
1
,
\"
lastFetchTime
\"
:
\(
pageLastFetchTime
)
,
\"
xmlModification
\"
:
\"
<ac:macro ac:name='jira'><ac:parameter ac:name='showSummary'>false</ac:parameter><ac:parameter ac:name='server'>JIRA</ac:parameter><ac:parameter ac:name='serverId'>54ed5447-b029-3ef0-b638-681b4647313b</ac:parameter><ac:parameter ac:name='key'>
\(
storyKey
)
</ac:parameter></ac:macro>
\"
}"
let
bodyString
=
"{
\"
pageId
\"
:
\"\(
pageId
)\"
,
\"
selectedText
\"
:
\"
项目背景
\"
,
\"
index
\"
:0,
\"
numMatches
\"
:
2
,
\"
lastFetchTime
\"
:
\(
pageLastFetchTime
)
,
\"
xmlModification
\"
:
\"
<ac:macro ac:name='jira'><ac:parameter ac:name='showSummary'>false</ac:parameter><ac:parameter ac:name='server'>JIRA</ac:parameter><ac:parameter ac:name='serverId'>54ed5447-b029-3ef0-b638-681b4647313b</ac:parameter><ac:parameter ac:name='key'>
\(
storyKey
)
</ac:parameter></ac:macro>
\"
}"
let
data
=
bodyString
.
data
(
using
:
.
utf8
)
let
data
=
bodyString
.
data
(
using
:
.
utf8
)
request
.
httpBody
=
data
request
.
httpBody
=
data
...
@@ -170,7 +170,8 @@ class Story: NSObject {
...
@@ -170,7 +170,8 @@ class Story: NSObject {
var
request
=
URLRequest
(
url
:
url
)
var
request
=
URLRequest
(
url
:
url
)
request
.
httpMethod
=
"POST"
request
.
httpMethod
=
"POST"
request
.
setValue
(
"application/x-www-form-urlencoded"
,
forHTTPHeaderField
:
"Content-Type"
)
request
.
setValue
(
"application/x-www-form-urlencoded"
,
forHTTPHeaderField
:
"Content-Type"
)
let
formString
=
"pid=
\(
pid
)
&issuetype=10003&parentIssueId=
\(
storyId
)
&atl_token=
\(
subtask_atl_token
)
&formToken=
\(
subtask_formToken
)
&summary=
\(
summary
)
&isCreateIssue=true&assignee=
\(
assignee
)
&reporter=wangyang&priority=3&issuelinks=issuelinks&issuelinks-linktype=blocks&isCreateIssue=true&isEditIssue=false&"
let
formString
=
"pid=
\(
pid
)
&issuetype=
\(
RepeatedWork
.
jira
!.
subtask_id
)
&parentIssueId=
\(
storyId
)
&atl_token=
\(
subtask_atl_token
)
&formToken=
\(
subtask_formToken
)
&summary=
\(
summary
)
&isCreateIssue=true&assignee=
\(
assignee
)
&reporter=wangyang&priority=3&issuelinks=issuelinks&issuelinks-linktype=blocks&isCreateIssue=true&isEditIssue=false&"
let
formData
=
formString
.
data
(
using
:
.
utf8
)
let
formData
=
formString
.
data
(
using
:
.
utf8
)
request
.
httpBody
=
formData
request
.
httpBody
=
formData
...
...
AutoJira/ViewController.swift
View file @
c07833d2
...
@@ -40,11 +40,21 @@ class JIRA: NSObject {
...
@@ -40,11 +40,21 @@ class JIRA: NSObject {
var
jiraProjectId
:
String
=
""
var
jiraProjectId
:
String
=
""
var
sprints
:
[
Sprint
]
=
[]
var
sprints
:
[
Sprint
]
=
[]
var
currentSprint
:
Sprint
?
var
currentSprint
:
Sprint
?
var
subtask_id
:
String
=
""
convenience
init
(
jiraProjectId
:
String
,
sprints
:
[
Sprint
])
{
convenience
init
(
jiraProjectId
:
String
,
sprints
:
[
Sprint
])
{
self
.
init
()
self
.
init
()
self
.
jiraProjectId
=
jiraProjectId
self
.
jiraProjectId
=
jiraProjectId
self
.
sprints
=
sprints
self
.
sprints
=
sprints
// like sub task 10302
// gengmei sub task 10003
if
jiraProjectId
==
"10108"
{
// 更美
subtask_id
=
"10003"
}
else
{
// like
subtask_id
=
"10302"
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment