Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
xiaofang li
MeterSphere
Commits
47cd07c2
Commit
47cd07c2
authored
3 years ago
by
chenjianxing
Committed by
jianxing
3 years ago
Browse files
Options
Download
Email Patches
Plain Diff
fix: 同步jira缺陷图片没了
parent
43f4df7b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
backend/src/main/java/io/metersphere/track/issue/AbstractIssuePlatform.java
+13
-0
...ava/io/metersphere/track/issue/AbstractIssuePlatform.java
backend/src/main/java/io/metersphere/track/issue/JiraPlatform.java
+5
-1
...rc/main/java/io/metersphere/track/issue/JiraPlatform.java
with
18 additions
and
1 deletion
+18
-1
backend/src/main/java/io/metersphere/track/issue/AbstractIssuePlatform.java
+
13
-
0
View file @
47cd07c2
...
...
@@ -264,6 +264,19 @@ public abstract class AbstractIssuePlatform implements IssuesPlatform {
return
input
;
}
protected
String
getImages
(
String
input
)
{
String
result
=
""
;
String
regex
=
"(\\!\\[.*?\\]\\((.*?)\\))"
;
if
(
StringUtils
.
isBlank
(
input
))
{
return
result
;
}
Matcher
matcher
=
Pattern
.
compile
(
regex
).
matcher
(
input
);
while
(
matcher
.
find
())
{
result
+=
matcher
.
group
();
}
return
result
;
}
protected
String
htmlImg2MsImg
(
String
input
)
{
// <img src="xxx/resource/md/get/a0b19136_中心主题.png"/> -> 
String
regex
=
"(<img\\s*src=\\\"(.*?)\\\".*?>)"
;
...
...
This diff is collapsed.
Click to expand it.
backend/src/main/java/io/metersphere/track/issue/JiraPlatform.java
+
5
-
1
View file @
47cd07c2
...
...
@@ -309,8 +309,12 @@ public class JiraPlatform extends AbstractIssuePlatform {
issues
.
forEach
(
item
->
{
setConfig
();
try
{
IssuesWithBLOBs
issuesWithBLOBs
=
issuesMapper
.
selectByPrimaryKey
(
item
.
getId
());
parseIssue
(
item
,
jiraClientV2
.
getIssues
(
item
.
getId
()));
item
.
setDescription
(
htmlDesc2MsDesc
(
item
.
getDescription
()));
String
desc
=
htmlDesc2MsDesc
(
item
.
getDescription
());
// 保留之前上传的图片
String
images
=
getImages
(
issuesWithBLOBs
.
getDescription
());
item
.
setDescription
(
desc
+
"\n"
+
images
);
issuesMapper
.
updateByPrimaryKeySelective
(
item
);
}
catch
(
HttpClientErrorException
e
)
{
if
(
e
.
getRawStatusCode
()
==
404
)
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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