Auto-populate nested list in description

C S Seshagiri October 16, 2024

Hi Team,

I am trying to auto-populate a nested list in the description field with behaviour, but I am unable to find options other than ordered and unordered lists. I am looking for something similar to what is shown in the picture.

Screenshot 2024-10-16 at 12.58.03 PM.png

Referred document : 

https://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/listItem/

2 answers

0 votes
Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 19, 2024

Hi @C S Seshagiri

For your requirement, you could try looking into typescript and play around with the bullet point formatting.

I gave a basic test in my environment with this code:-

const descriptionValue = getFieldById("description").getValue();

let str = "blah•blah•blah";

let strArr = str.split("\u2022");

let newStr = '\u2022' + strArr.join("\n\u2022");


// If description field is wiki markup access the content property
if (typeof descriptionValue !== "string") {
const descriptionValueContent = descriptionValue.content.toString();

if (!descriptionValueContent) {

getFieldById("description").setValue({
"version": 1,
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Test\n",
"marks": [
{
"type": "strong"
}
]
},
{
"type": "text",
"text": newStr
}
]
}
]
}

)
}
}

Please note that the sample code above is not 100% exact to your environment. Hence, you must make the required modifications.

Below is the output that I was able to achieve:-

img1.png

I hope this helps to answer your question. :-)

Thank you and Kind regards,
Ram

 

0 votes
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 16, 2024

Hi @C S Seshagiri 

Create a new custom field of the type text paragraph, set the context to the required projects and set a place holder text.

Update the screens used in the project(s), to present the field.

This is the simple solution.

I you want to keep using the description field, create an automation that on issue creation copies the value from the CF field to the description field.

Then only use the field on the create screen and not on edit or view screen.

Suggest an answer

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

Atlassian Community Events