- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2023 10:03 PM
I have the field u_jira_project on the incident table of type Reference to u_jira_project table. I need to create a form button called 'Create Jira'. When the user click on this button, he needs to see a pop up with all the projects from u_jira_project table divded into two columns: u_project_name, u_project key. After the user chose a project, the value of the project that he chose need to be populated inside u_jira_project field on the incident table. How can I achieve that?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2023 03:39 AM
Their is one more error: make it name,key
var $j = jQuery.noConflict();
var ga = new GlideAjax('ShowJiraProject');
ga.addParam('sysparm_name', 'getProjects');
ga.getXML(parseResponse);
function parseResponse(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
alert(answer);
var str = "<div><table class='table' id='tableData'><tr><th>Name</th><th>Key</th></tr>";
answer = JSON.parse(answer);
for (var i = 0; i < answer.length; i++) {
str = str + '<tr id="tableRow"><td>' + answer[i].name +'</td><td>' + answer[i].key + '</td></tr>';
}
$j('#iframee').append(str);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2023 09:57 AM
There are a lot many tasks in this, will try to help you as I get time daily!
I am also stuck somewhere that has to be completed before this week ends!
I hope you understand 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2023 01:22 PM
Hi
You can achieve this functionality by creating an ui-action on the incident table, which opens a dialog window with a list of projects from the u_jira_project table. Once the user selects a project, a script can set the value of the u_jira_project field on the incident table to the selected project's sys_id.
Please have a look at Exalate integration software. It enables you to synchronize data between the two systems, including incidents and projects, automating the transfer and ensuring they remain in sync.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2023 04:50 AM
@Prince Arora will try it tmrw and let u know. Thank you so much for ur help, If I want to give the user an option to choose one of the projects and not just to see is it possible? I want that the user will choose a ira project and the value will be populated inside u_jira_project field on the incident table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2023 05:24 AM
Perform onclick functionality on the records, once user clicks on the record, you need to pick sys_id of record and store it into the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2023 09:18 AM
@Prince Arora How can I adjust the scrips for doing it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2023 09:53 AM
@Prince Arora is there any chance to help me with this task, i tried to give as much details that I can.
1. When the user click on "Create Jira" UI Action on the incident table, he needs to see a list of Jira projects and he needs to have the option to choose from one of them. 2. The list of projects that are being displayed shown in two columns from u_jira_table. The two columns are of type string and their backend name is: u_project_name, u_project key. 3. After the user chose a jira project from the list, the project that he chose needs to be populated with the u_project_name value inside u_jira_project field on the incident table. u_jira_project field on the incident table is a reference field to the table u_jira_project. 4. After the user chose a project from the list, the service now system needs to create a new ticket in Jira system. This should be done using the 'Jira' Rest Message and the POST HTTP Method 'create_bug'. 5. I already created the 'Jira' REST Message and the POST HTTP Method 'create_bug'. We dont need to set in the script the endpoint, the auth, the headers, and the content because I already set everything manually inside create_bug post method. 6. This is the create_bug JSON content that I provided: { "fields":{ "description":"${description}", "issuetype":{ "name":"Bug" }, "project":{ "key":"${project_key}" }, "summary":"${summary}", "priority":{"id":"${priority}"} } } 7. when we pass the parameters to Jira system, we need to get the values like this: description = description from current incident key = the u_project_key of the u_project_name that the user chose from the list of project from u_jira_project table summary = short_description from current incident priority = priority from current incident 8. When we are creating the ticket in jira system using the post method, we suppose to get back from jira ID. We need to populate u_jira_id field on the current incident with the ID that we are getting from Jira
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2023 09:57 AM
There are a lot many tasks in this, will try to help you as I get time daily!
I am also stuck somewhere that has to be completed before this week ends!
I hope you understand 🙂