diff --git a/jenkins_jobs/modules/view_list.py b/jenkins_jobs/modules/view_list.py
index 9a6f7494c..7ead743a9 100644
--- a/jenkins_jobs/modules/view_list.py
+++ b/jenkins_jobs/modules/view_list.py
@@ -324,7 +324,8 @@ class List(jenkins_jobs.modules.base.Base):
}
)
if jobnames is not None:
- jobnames = sorted(jobnames) # Job names must be sorted in the xml
+ # Job names must be sorted in the xml
+ jobnames = sorted(jobnames, key=str.lower)
for jobname in jobnames:
XML.SubElement(jn_xml, 'string').text = str(jobname)
diff --git a/tests/views/fixtures/view_list001.xml b/tests/views/fixtures/view_list001.xml
index 1d74edf80..5f8e1804f 100644
--- a/tests/views/fixtures/view_list001.xml
+++ b/tests/views/fixtures/view_list001.xml
@@ -10,6 +10,7 @@
job-name-1
job-name-2
job-name-3
+ Job-name-4
diff --git a/tests/views/fixtures/view_list001.yaml b/tests/views/fixtures/view_list001.yaml
index 5067bc189..5ce9f0fcb 100644
--- a/tests/views/fixtures/view_list001.yaml
+++ b/tests/views/fixtures/view_list001.yaml
@@ -7,6 +7,7 @@ job-name:
- job-name-1
- job-name-3
- job-name-2
+ - Job-name-4
columns:
- status
- weather