Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
  • Community
  • Q&A
  • Jira
  • Questions
  • Ansible fails to get records because of Deprecation of JQL search and Evaluate expression endpoint

Ansible fails to get records because of Deprecation of JQL search and Evaluate expression endpoint

clerambeau
April 18, 2026

Hello. I am new to JIRA and Atlassian products. My interest grows every day though. I have anOutput Ansible playbook that is supposed to query my trial JIRA for all task metadata under a project named "PROJ'. It fails with a notice of JQL deprecation.

#############ANSIBLE CODE#######################

---
    - name: Get all task metadata for project PROJ
      hosts: localhost
      connection: local
      gather_facts: true
      vars_files:
        - vars/main.yml

      tasks:

        - name: Create a new Jira issue
          community.general.jira:
            uri: "{{ jira_url }}"
            username: "{{ jira_user }}"
            password: "{{ jira_api_token }}"
            operation: search
            jql: "project = 'PROJ' AND issuetype = 'Task' AND status != 'Done'"
            maxresults: 50
          register: jira_tasks

        - name: Display task keys
          ansible.builtin.debug:
            msg: "Found task: {{ item.key }}"
          loop: "{{ jira_tasks.meta.issues }}"
############END OF ANSIBLE CODE#############
Output:

[ansible_admin@ctrl ansible]$ time ansible-playbook ./playbooks/jira.findalltasks.yml
[WARNING]: Collection community.general does not support Ansible version 2.16.3

PLAY [Create JIRA ID 2872.56] *************************************************************************************************************************************************

TASK [Gathering Facts] ********************************************************************************************************************************************************
ok: [localhost]

TASK [Create a new Jira issue] ************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "['The requested API has been removed. Please migrate to the /rest/api/3/search/jql API. A full migration guideline is available at https://developer.atlassian.com/changelog/#CHANGE-2046']"}

PLAY RECAP ********************************************************************************************************************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

When I go to the link https://developer.atlassian.com/changelog/#CHANGE-2046 it gives me a lot of information I do not understand how to turn into a solution to this problem. Usually, if something is deprecated, there is a superseding replacement module (for example, something like "jql.2.0", of course, it doesnt exist). So, how do I alter my Ansible playbook above to get the query results with a different jql module? 
It doesnt have to be Ansible code, could be any CLI code I will be able to run from a LINUX box. I will code it into a shell script and have Ansible execute it, instead of the deprecated jql.
Examples will be greatly appreciated. Thanks.
Nestor Kandinsky-Clerambeau.

1 answer

1 accepted

2 votes
Answer accepted
Arkadiusz Wroblewski
Community Champion
April 19, 2026

Hello and welcome to the Community @clerambeau 

The issue isn’t your JQL, but the search endpoint itself. Jira Cloud recently removed the legacy search path, which broke older versions of the community.general.jira module.

To fix this, upgrade your collection and set cloud: true for the search operation. If upgrading isn't an option, you’ll need to call the Jira REST API directly via the uri module. Your JQL syntax is correct; the module simply needs to be configured to use the modern Cloud-compatible endpoint. 

clerambeau
April 19, 2026

Got it, so I need to update the python code in the Ansible module itself. That is what I was looking for. Thank you, @Arkadiusz Wroblewski 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin Site Admin
TAGS
AUG Leaders

Atlassian Community Events