Want to create the HTML macro and it should have the mentioned fields liked linked issue?
Asked by Deepika Venkatesan:

Want to create the HTML macro in the confluence and it's having the following fields like team, Linked issue (Issue belongs to), Environments and creating the ticket to jira through HTML macro


Answers:
author: Sebastian Krzewi?ski
body: Hi [@Deepika Venkatesan](/t5/user/viewprofilepage/user-id/5520379)

Here you can find info how to write macro in Confluence - <https://confluence.atlassian.com/doc/writing-user-macros-4485.html>

Regards,

Seba

comments: author: Deepika Venkatesan
body: Hi [@Sebastian Krzewi?ski](/t5/user/viewprofilepage/user-id/1561725)   

Here is the code for creating the ticket using the HTML code in confluence. We are getting blank space when I create a ticket by linked issue.  

\<!DOCTYPE html\>  
\<html\>  
\<head\>  
\<style\>  
table, td {  
border: 1px solid black;  
}  
label {  
font-size: 16px;  
}  
h1, h2 {  
font-size: 24px;  
}  
button {  
font-size: 16px;  
height: 28px;  
width: 92px;  
}  
\</style\>  
\</head\>  
\<body\>  
\<table style="width:100%"\>  
\<tr\>  
\<td\>  
\<h1\>\<u\>\<b\>Notes:\</b\>\</u\>\</h1\>  
\<ul\>  
\<li\>Step 1: Select the Environment\</li\>  
\<li\>Step 2: Squad -\> Select the Squad you belong to\</li\>  
\<li\>Step 3: Team -\> Select the Team you want the bug to be assigned to\</li\>  
\<li\>Step 4: Answer all the queries in the description and furnish proper details of the issue\</li\>  
\<li\>Step 5: Update the Linked issue field -\> select as belongs to\</li\>  
\<li\>Step 5a: Under issue mention the story under which this bug is related\</li\>  
\<li\>Step 6: Provide valid attachments and screenshots and submit\</li\>  
\</ul\>  
\</td\>  
\</tr\>  
\<tr\>  
\<td\>  
\<h2\>\<u\>\<b\>Raise BlackHorse Environments Bugs:\</b\>\</u\>\</h2\>  
\<label for="env_dm11_blackhorse-select"\>Environment:\</label\>  
\<select name="ENV" id="env_dm11_blackhorse-select"\>  
\<option value=""\>\</option\>  
\<option value="ENV_BH_CQA1"\>CQA1\</option\>  
\<option value="ENV_BH_CQA2"\>CQA2\</option\>  
\<option value="ENV_BH_CQA3"\>CQA3\</option\>  
\<option value="ENV_BH_CQA4"\>CQA4\</option\>  
\<option value="ENV_BH_CQA5_INT_TEST"\>CQA5\</option\>  
\<option value="ENV_BH_CQA5_PRE_PROD"\>CQA6(PRE-PROD)\</option\>  
\<option value="ENV_BH_CQA7"\>CQA7\</option\>  
\<option value="ENV_BH_PROD"\>BH-PROD\</option\>  
\</select\>  
\<br\>  
\<label for="featureTeam_blackhorse_dm11"\>Squad:\</label\>  
\<select name="FEATURETEAM" id="featureTeam_dm11_blackhorse-select"\>  
\<option value=""\>\</option\>  
\<option value="BH"\>BlackHorse\</option\>  
\<option value="DevOps"\>DevOps\</option\>  
\</select\>  
\<br\>  
\<label for="team_blackhorse_dm11"\>Team:\</label\>  
\<select name="FEATURETEAM" id="team_blackhorse_dm11-select"\>  
\<option value=""\>\</option\>  
\<option value="159701"\>CJT_Platform Engineering\</option\>  
\<option value="149803"\>DM Strategies Motor 1\</option\>  
\<option value="149804"\>DM Strategies Motor 2\</option\>  
\<option value="149805"\>DM SaaS Core\</option\>  
\</select\>  
\<br\>  
\<label for="Issue_blackhorse_dm11-select"\>Issue Belongs to (e.g. HMTFD-XXXXX):\</label\>  
\<input name="Issue" id="Issue_blackhorse_dm11-select"\>  
\<br\>  
\<button onclick="submit_dm11_blackhorse()"\>Submit\</button\>  
\</td\>  
\</tr\>  
\</table\>

\<script\>  
function submit_dm11_blackhorse() {  
var api = "<https://jira.devops.lloydsbanking.com/secure/CreateIssueDetails!init.jspa>?";  
var project = "pid=68001";  
var issuetype = "issuetype=1";  
var priority = "priority=5";  
var labels = "labels=BH";  
var team = "customfield_10616=152138";  
var issuelink = "issuelinks-linktype=belongs to";  
var env_dm11blackhorse = document.getElementById("env_dm11_blackhorse-select").value;  
var featureTeam_dm11blackhorse = document.getElementById("featureTeam_dm11_blackhorse-select").value;  
var team_dm11blackhorse = document.getElementById("team_blackhorse_dm11-select").value;  
var Issue_dm11blackhorse = document.getElementById("Issue_blackhorse_dm11-select").value;  
var flag = "true";  
var linkedIssue = "\&issuelinks-issues-multi-select=";

var description = "description= This+bug+has+been+assigned+to+you+for+prioritization - kindly+help+us+to+prioritize+this+Bug.%00%0A%00%0A+Problem/Issue:%00%0A%00%0A+Attach+Log+Files+and+Screenshots";

// Add form validation here

// Submit the form  
}  
\</script\>  
\</body\>  
\</html\>


Tags: confluence-data-center

data-center