# Comparing Two field values in JQL

**URL:** <https://forum.library.adaptavist.com/t/comparing-two-field-values-in-jql/329>\
**Category:** Scripts\
**Tags:** built-in-script, jira\
**Created:** [May 17, 2023, 3:30pm UTC](https://forum.library.adaptavist.com/t/comparing-two-field-values-in-jql/329 "2023-05-17T15:30:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CupplesJ](https://avatars.discourse-cdn.com/v4/letter/c/5fc32e/32.png) [@CupplesJ](https://forum.library.adaptavist.com/u/CupplesJ)\
**Post date:** [May 17, 2023, 3:30pm UTC](https://forum.library.adaptavist.com/t/comparing-two-field-values-in-jql/329/1 "2023-05-17T15:30:54Z")

</div>

I know that we can use the “issueFunction in expression” to compare two fields. See the following for  
reference [Calculations](https://docs.adaptavist.com/sr4js/6.41.0/features/jql-functions/included-jql-functions/calculations#expression)

However, this works for fields that have no spaces in the name, i.e.  
issueFunction in expression(“”, “creator != reporter”)

How do you do this for same search for a custom field that has a space in the name? I cannot get it to work, even if I reference the custom field notation.  
issueFunction in expression(“”, “summary != custom field”) does not work  
issueFunction in expression(“”, “summary != cf[11111]”) does not work

Thanks!

---

<div class="post-metadata">

**Author:** ![jechlin](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.library.adaptavist.com/jechlin/32/85_2.png) [@jechlin](https://forum.library.adaptavist.com/u/jechlin)\
**Post date:** [May 17, 2023, 6:42pm UTC](https://forum.library.adaptavist.com/t/comparing-two-field-values-in-jql/329/2 "2023-05-17T18:42:48Z")

</div>

Hi - not sure if you saw this on the page you mentioned:

Custom field names are likely to have spaces, which can’t be parsed. If so, remove the spaces. It’s not case-sensitive but use camel-case for maximum readability. If your field names have any other punctuation you must use the format customfield\_12345.

So in your example you could use `CustomField`.

cheers, jamie

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/adaptavistlibrary/original/1X/ceb18adf14fa58b4c6de03aa69ada8b07359620c.png) [@system](https://forum.library.adaptavist.com/u/system)\
**Post date:** [November 13, 2023, 6:43pm UTC](https://forum.library.adaptavist.com/t/comparing-two-field-values-in-jql/329/3 "2023-11-13T18:43:25Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
