Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to import/upload Restricted comments via JSON import?

Rahul Bisht January 19, 2023

Hi Team,

We are trying to migrate JIRA issues from JIRA On-Premise to JIRA Cloud. Can someone please help me with the JSON string to import comments as restricted to a particular Role-level. 

I have tried to use below property but that didn't help.  

"properties":[{"key":"sd.public.comment","value":{"internal":"true"}}]

Regards,

Rahul Bisht

1 answer

0 votes
Darryl Lee
Community Champion
January 20, 2023

Hi @Rahul Bisht --

If you're migrating issues from Jira on-prem to Cloud I would recommend seeing if you can use the Jira Cloud Migration Assistant which can now even do single projects at a time.

But if for some reason you need to do it yourself, then ok, looking at the documentation for adding comments it specifies how you restrict viewing by using the visibility parameter in the body:

var bodyData = `{ 
"visibility": {
"identifier": "Administrators",
"type": "role",
"value": "Administrators"
},
"body": {
"type": "doc",
"version": 1,
"content": [
{ "type": "paragraph",
"content": [
{
"text": "Lorem ipsum...",
"type": "text"
}
]

}
]
}
}`
;

That's swiped straight from the Forge example but the body data should be the same regardless of what language you're using. 

Rahul Bisht January 22, 2023

Hi @Darryl Lee ,

Thanks a lot for your reply. I tried to search for JIRA Cloud Migration Assistant in JIRA marketplace but couldn't find this app. Can you please check and suggest from where can I download this utility. Thanks in advance.

JIRA Cloud Migration Assistant.png

 

Regards,

Rahul Bisht

Darryl Lee
Community Champion
January 22, 2023

Hi @Rahul Bisht --

Jira Cloud Migration Assistant runs on your on-premises instance, so you'll need to install it there. Here is the marketplace listing:

Documentation on installing and running it is here:

Rahul Bisht January 22, 2023

Hi @Darryl Lee 

I tried to use visibility parameter to restrict comment visibility as per below JSON but when I tried to upload these comments using the JSON importer, then the comments were not added as restricted. They are still visible to all users.  

"comments": [

{
"body": "This is sample private comment from Rahul",
"author": "62a6ed619ffc930068e0123f",
"created": "2023-01-19T16:05:05.409+0000",
"updated": "2023-01-19T16:05:05.409+0000",
"visibility": {
"type": "role",
"value": "Administrators",
"identifier": "Administrators"
}
},
{
"body": "This is sample private comment from Craig",
"author": "70121:9536df2b-8f56-4467-8ed5-c17b3fd718e5",
"created": "2023-01-19T16:06:05.409+0000",
"updated": "2023-01-19T16:06:05.409+0000",
"visibility": {
"identifier": "APAC Iptor Team",
"type": "group",
"value": "APAC Iptor Team"
}}]

 

I also found one JIRA (https://jira.atlassian.com/browse/JRASERVER-69221) which is still in Open status where the ability to use visibility parameter is not supported by JSON importer.

Can you please provide some feedback on this and suggest if there is any other way to restrict comment visibility using the JSON importer or do we have any other plugin/utility that we can use to achieve above purpose. Thanks in advance.

Regards,

Rahul Bisht

Darryl Lee
Community Champion
January 22, 2023

Ah... I missed that you were using the JSON Importer. Apologies - I thought you were scripting this using the API or something.

That is disappointing to hear about the bug.

I would say that if you are able to import an entire project, then you should use JIRA Cloud Migration Assistant. Even if you don't need all of the issues, it might be easier to use it and then go ahead and delete the ones you didn't want to migrate.

Rahul Bisht January 22, 2023

Hi @Darryl Lee 

Sorry for not being able to inform this earlier but we will not be able to use JIRA Cloud Migration Assistant since we are using very old version of on-premises JIRA.

Regards,

Rahul Bisht

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events