Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 96 lines (79 sloc) 2.806 kb
12fd529 @hhariri Updated forms
hhariri authored
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Custom YouTrack Submit Form</title>
6cf7b65 @vadimgurov add no-local-deps version
authored
5
12fd529 @hhariri Updated forms
hhariri authored
6 <link rel="stylesheet" href="css/bootstrap.min.css">
6cf7b65 @vadimgurov add no-local-deps version
authored
7
8 <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
9 <script type="text/javascript" src="js/bootstrap.min.js"></script>
12fd529 @hhariri Updated forms
hhariri authored
10 </head>
11 <body>
12
13
14 <h3>Submit Issue</h3>
15
16 <form onsubmit="createIssue(); return false;" class="form-horizontal">
17 <div class="control-group">
18 <label class="control-label" for="project">Project</label>
19
20 <div class="controls">
21 <select name="project" id="project">
22 <option>Loading projects...</option>
23 </select>
24 </div>
25 </div>
26
27 <div class="control-group">
28 <label class="control-label" for="summary">Summary</label>
29
30 <div class="controls">
31 <input type="text" id="summary" style="width: 50%"/>
32 </div>
33 </div>
34
35 <div class="control-group">
36 <label class="control-label" for="description">Description</label>
37
38
39 <div class="controls">
40 <textarea name="description" id="description" cols="30" rows="10" style="width: 50%"></textarea>
41 </div>
42
43 </div>
44 <div class="control-group">
45 <div class="controls">
46 <input type="submit" value="Create Issue" class="btn btn-primary"/>
47 <span id="result">Issue created!</span>
48 </div>
49
50 </div>
51 </form>
52
53 <script type="text/javascript">
54 function createIssue() {
55 $.ajax({
56 url:"http://scrumboard.myjetbrains.com" +
57 "/youtrack/rest/issue",
58 dataType:"json",
59 type:"POST",
60 data:{
61 project:$("#project").val(),
62 summary:$("#summary").val(),
63 description:$("#description").val()
64 }
65 }).done(function (data) {
66 $("#result").show();
67 $("#summary").val('');
68 $("#description").val('');
69 });
70 }
71
72 function loadProjects() {
73 $.ajax({
74 url:"http://scrumboard.myjetbrains.com" +
75 "/youtrack/rest/project/all",
76 dataType:"json"
77 }).done(function (data) {
78 var project = $("#project");
79 project.empty();
80 $.each(data, function(index, value) {
81 project.append($("<option/>", {
82 value: value.shortName,
83 text: value.name
84 }))
85 });
86 });
87 }
88
89 $(function(){
90 $("#result").hide();
91 loadProjects();
92 })
93 </script>
94
95 </body>
96 </html>
Something went wrong with that request. Please try again.