grim/youtrack-import
Clone
Summary
Browse
Changes
Graph
Split the version field into AffectedVersion and FixVersion while having trac and bitbucket use AffectedVersion. Also put the trac milestone into the Fix Version.
draft
2020-08-11, Gary Kramlich
faf8f5a4120f
Split the version field into AffectedVersion and FixVersion while having trac and bitbucket use AffectedVersion. Also put the trac milestone into the Fix Version.
package
youtrack
import
(
"sort"
"time"
)
type
Comment
struct
{
Author
string
Text
string
Created
time
.
Time
Updated
time
.
Time
Markdown
bool
}
func
sortComments
(
comments
[]
*
Comment
)
{
sort
.
Slice
(
comments
,
func
(
i
,
j
int
)
bool
{
return
comments
[
i
].
Created
.
Before
(
comments
[
j
].
Created
)
})
}
func
(
c
*
Comment
)
extractAttachments
(
i
*
Issue
)
error
{
if
!
c
.
Markdown
{
return
nil
}
modified
,
attachments
,
err
:=
extractAttachments
(
i
.
Number
,
c
.
Author
,
c
.
Text
,
c
.
Created
,
)
if
err
!=
nil
{
return
err
}
if
len
(
attachments
)
>
0
{
c
.
Text
=
modified
i
.
Attachments
=
append
(
i
.
Attachments
,
attachments
...
)
}
return
nil
}