 
 (defn read-build-number-for-job
     [jenkins-url jenkins-job-prefix-url job-name]
-    (let [full-json-url (str jenkins-url jenkins-job-prefix-url (encode-spaces job-name) "/api/json?pretty=true")
+    (let [full-json-url (job-url jenkins-url jenkins-job-prefix-url job-name "/api/json?pretty=true")
           inputstr (slurp full-json-url)]
         (if inputstr
             (-> (json/read-str inputstr)

    [^String url]
    (clojure.string/replace url " " "%20"))

(defn list-of-all-jobs-url
    [jenkins-url jenkins-job-list-url]
    (str jenkins-url jenkins-job-list-url))

(defn read-job-info-as-json
    "Fetch the timestamp and duration of the last build from Jenkins server."
    [jenkins-url jenkins-job-prefix-url job-name]
    (let [full-json-url (job-url jenkins-url jenkins-job-prefix-url job-name "/lastBuild/api/json?pretty=true")
          inputstr (slurp full-json-url)]
        (if inputstr
            (let [parsed   (json/read-str inputstr)
