Since "It is not important where each element is placed":
a = {a1, a2, a3, a4, a5, a6}
mat = SparseArray[
Rule[#, #2] & @@@ Thread@{Flatten[Table[{i, j}, {i, 3}, {j, i, 3}], 1], a}];
mat // MatrixForm
$\left(
\begin{array}{ccc}
\text{a1} & \text{a2} & \text{a3} \\
0 & \text{a4} & \text{a5} \\
0 & 0 & \text{a6} \\
\end{array}
\right)$
If you have a list of 36 elements that you want to turn into a 8x8 upper triangle matrix:
l = Range@36;
mat = SparseArray[
Rule[#, #2] & @@@ Thread@{Flatten[Table[{i, j}, {i, 8}, {j, i, 8}], 1], l}];
mat // MatrixForm
$\left(
\begin{array}{cccccccc}
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 \\
0 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\
0 & 0 & 16 & 17 & 18 & 19 & 20 & 21 \\
0 & 0 & 0 & 22 & 23 & 24 & 25 & 26 \\
0 & 0 & 0 & 0 & 27 & 28 & 29 & 30 \\
0 & 0 & 0 & 0 & 0 & 31 & 32 & 33 \\
0 & 0 & 0 & 0 & 0 & 0 & 34 & 35 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 36 \\
\end{array}
\right)$
Here is an attempt to make it more robust:
mat[l_] := Module[{n = Abs[1/2 (1 - Sqrt[1 + 8*Length@l])]},
If[IntegerQ@n,
SparseArray[Rule[#, #2] & @@@ Thread@{Flatten[Table[{i, j}, {i, n}, {j, i, n}], 1], l}],
"Wrong length. The length should be " <>
ToString[Or @@ ((#[n]*(#[n] + 1)/2) & /@ {Ceiling, Floor})] <> "."]]
Usage:
l = Range@11;
mat@l
Wrong length. The length should be 15 || 10.
l = Range@10;
mat@l
$\left(
\begin{array}{cccc}
1 & 2 & 3 & 4 \\
0 & 5 & 6 & 7 \\
0 & 0 & 8 & 9 \\
0 & 0 & 0 & 10 \\
\end{array}
\right)$