Hello
In my Jira Cloud i have created 2 behaviours for set a diferents description in the system field description in two issue type but in the screen creation when i switch the issue type story to Epic and the description dont change
Behaviour n°1 :
Issue Type = Story
Description = “hello set your name : “
Behaviour n°2 :
Issue Type = Epic
Description = “give me your reference : “
This is my script :
------------------------------START SCRIPT-----------------------------------------------
Hey @Salim Hammar , Welcome to Atlassian Community.
You probably have to do a call to wait for context. Try something like this and see if it works with just words.
const context = await getContext();
const issueType = context.extension.issueType.name;
const descriptionField = getFieldById("description");
let descriptionText;
if (issueType === "Story") { descriptionText = "hello set your name :"; } else if (issueType === "Epic") { descriptionText = "give me your reference :"; } else {
//default text descriptionText = "Any other default description if needed.";
}descriptionField.setValue({ "version": 1, "type": "doc", "content": [ { "type": "paragraph", "content": [ { "type": "text", "text": descriptionText, } ] } ] });
It looks like you are trying to also put in a table there. You can check out the ADF format samples from Create HTML Table with Issue Details .
Hope this helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i would like to set this :
Can you help me to set this in the script that you have send me , the script for this table generated here : Document builder
this is script you can you generate this table in the link :
{
"version": 1,
"type": "doc",
"content": [
{
"type": "table",
"attrs": {
"isNumberColumnEnabled": false,
"layout": "default",
"localId": "5c42930a-af01-4057-bd6b-c0fb86e94486",
"width": 760
},
"content": [
{
"type": "tableRow",
"content": [
{
"type": "tableHeader",
"attrs": {},
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "test 1",
"marks": [
{
"type": "strong"
}
]
}
]
}
]
},
{
"type": "tableHeader",
"attrs": {},
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "test 2",
"marks": [
{
"type": "strong"
}
]
}
]
}
]
},
{
"type": "tableHeader",
"attrs": {},
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "test 3",
"marks": [
{
"type": "strong"
}
]
}
]
}
]
}
]
},
{
"type": "tableRow",
"content": [
{
"type": "tableCell",
"attrs": {},
"content": [
{
"type": "paragraph",
"content": []
}
]
},
{
"type": "tableCell",
"attrs": {},
"content": [
{
"type": "paragraph",
"content": []
}
]
},
{
"type": "tableCell",
"attrs": {},
"content": [
{
"type": "paragraph",
"content": []
}
]
}
]
},
{
"type": "tableRow",
"content": [
{
"type": "tableCell",
"attrs": {},
"content": [
{
"type": "paragraph",
"content": []
}
]
},
{
"type": "tableCell",
"attrs": {},
"content": [
{
"type": "paragraph",
"content": []
}
]
},
{
"type": "tableCell",
"attrs": {},
"content": [
{
"type": "paragraph",
"content": []
}
]
}
]
}
]
},
{
"type": "paragraph",
"content": []
}
]
}
Thanks in advance for your help boss ;)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Salim Hammar ,
to set the ADF, you can use something like this below. The format doesn't look pretty as I'm just copy pasting from another sample I had, I am generalising for all issuetypes, you will need to set the issuetype requirements etc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.