Create Jira Button on incident table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2023 12:24 AM
This is the flow of the task:
1. the user click on 'Create Jira' button from the current incident.
2. After clicking on the button a pop up with a list of project with u_project_name and their relevant u_project_key is being displayed from u_jira_project table. (Both fields columns are type String).
3. Then the user can choose a project and then the current field u_jira_project (type Reference to u_jira_project_table) on the incident needs to be populated with the value that the user chose.
4. At the same time that the field u_jira_projectis being populated with value that the user chose, we need to create a ticket in Jira system using 'Jira' rest message and his 'create_bug' Post http method.
5. After creating the ticket in Jira system, the Jira system will provide a response back. We need to take this response and pull from their the id and populated the field u_jira_id on the current incident.
I already created a rest message 'Jira' with HTTP Post Method 'create_bug'.
This is the JSON Content:
{
"fields":{
"description":"${description}",
"issuetype":{
"name":"Bug"
},
"project":{
"key":"${project_key}"
},
"summary":"${summary}",
"priority":{"id":"${priority}"}
}
}
This is the map field for the dynamic parameters (all the fields need to pass a string values and not as sys_id) from the Content JSON:
${description} = current incident description
${project_key} = the related u_project_key of the u_project_name that the user chose from the list of project ${summary} = current incident short_description
${priority} = we need to see what is the value of the current incident priority and then do this mapping to string values: If the value is 1, need to pass string "Critical"
if the value is 2, need to pass string "High"
if the value is 3, need to pass string "Medium"
if the value is 4, need to pass string "Low
I know that this can be done using UI Action, UI Page and Script Include but Im struggling. I dont know how to do the scripting part of each section.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2023 01:36 AM
Hi @Alon Grod,
Well, i yet to attempt my hands on chat gpt. But you can try to achieve this, by creating a new ui-action on the incident table and use the 'gsftSubmit' function to submit the form.
Inside the ui-action, you can display a pop-up dialog window with the available jira_projects and select one of them.
Parallelly, you can make the field on the table pull from the jira project table via the choice list in the advanced view of the dictionary entry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2023 01:39 AM
@Alon Grod
Similarly, you can also refer below link to achieve your requirement.
https://www.servicenow.com/community/developer-forum/how-to-create-a-button-on-the-incident-form/m-p...