Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Field cf[10015] - Start date is not working

Marc
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 12, 2025

Developing python script to fetch JIRA logs to generate the timesheet 

1. Wanted to fetch the custom field Start date cf[10015] but it is giving null 

jql = f'''
assignee = {assignee_id}
AND (
    cf[10015] >= "{start_date}" AND cf[10015] <= "{end_date}"
)
ORDER BY created ASC
If I add the Actual start and Actual End 
 jql = f'''
# assignee = {assignee_id}
# AND (
#   (created >= "{start_date}" AND created <= "{end_date}") OR
#   (updated >= "{start_date}" AND updated <= "{end_date}") OR
#   (cf[10008] >= "{start_date}" AND cf[10008] <= "{end_date}") OR
#   (cf[10009] >= "{start_date}" AND cf[10009] <= "{end_date}")
# )
It is working but i dont want to add beacuse Actual Start filed contain time too which is not required 
If this will not work then suggest me which date picker field should i consider to fetch the date 

1 answer

0 votes
Tuncay Senturk _Snapbytes_
Community Champion
August 13, 2025

Hi @Marc 

Welcome to the Community!

I am unsure if I understood your problem.

Are you sure the customfield's value is not null, check adding this to the JQL

AND cf[10015] is not EMPTY

If this customfield is date only custom field can you make sure that you are using YYYY-MM-DD format?

Marc
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 13, 2025

Hi,

I am attachnig the screeshot to clarify Filter.png

Tuncay Senturk _Snapbytes_
Community Champion
August 13, 2025

Is this "Start date" that we see on the screenshot the cf[10015]? If yes, these rows indicate that they are July 01, so we don't expect them to be between 2025-08-01 and 2025-08-31. My second question, are you sure that it's a Date field?

Marc
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 14, 2025

Hi Tuncay,

 

Sorry, my mistake refer the recent screenshot

Filter.png

2nd Question - Start date

filter2.png

Tuncay Senturk _Snapbytes_
Community Champion
August 14, 2025

Great, I see that using the start date in the JQL returns results as expected. So, do you mean that JQL runs OK in the issue navigator but it doesn't work via the Python script? 

Marc
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 14, 2025

Yes, you are right it is not working in python script now let me know is it feasible to use start date to generate the timesheet. Because created and updated wont give the exact date 


jql = f'''
assignee = {assignee_id}
AND (
 cf[10015] >= "{start_date}" AND cf[10015] <= "{end_date}"
)
ORDER BY created ASC
'''
Tuncay Senturk _Snapbytes_
Community Champion
August 14, 2025

Yes, of course it's OK to use any field/custom field in your query.

Could you log the JQL which is generated by the script? Seeing the final generated JQL (before executing) will help us have a better idea.

Marc
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 14, 2025

Sorry i cannot share the log due to confidential but i was using the below code and i gues created and updated is blocking 

 

 jql = f'''
 assignee = {assignee_id}
 AND (
   (created >= "{start_date}" AND created <= "{end_date}") OR
   (updated >= "{start_date}" AND updated <= "{end_date}") OR
   cf[10015] >= "{start_date}" AND cf[10015] <= "{end_date}"
 )
One more confusion below, for example if the team member Add the start date as 4th August and in the work logged it is mentioned as 14th August so it is misleading the entry is added for 14th August but code is written for bifurcating with Start date 
Screenshot 2025-08-14 142350.pngScreenshot 2025-08-14 164111.png


If you check the above sample sheet all task are logged for todays date ?


Tuncay Senturk _Snapbytes_
Community Champion
August 14, 2025

I don't think sharing the final JQL from the code breaches confidentiality. I just need to see the JQL that is run via the code (to verify that the date values are assigned in the correct ISO format and also to check quotes and parentheses).

Marc
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 14, 2025

assignee = 
AND (
(created >= "2025-08-01" AND created <= "2025-08-31") OR
(updated >= "2025-08-01" AND updated <= "2025-08-31") OR
cf[10015] >= "2025-08-01" AND cf[10015] <= "2025-08-31"
)
ORDER BY created ASC

Tuncay Senturk _Snapbytes_
Community Champion
August 14, 2025

I suppose you intentionally removed the assignee's right part. If not, that's a problem.

Considering the fact that this JQL is generated by the code, this MUST work. Removing created and updated fields and leaving only the cf[10015] equation should work. Since that's the date field and the date part is generated correctly (yyyy-MM-dd), I cannot see any problem.

assignee = <accountId>
AND (
cf[10015] >= "2025-08-01" AND cf[10015] <= "2025-08-31"
)

 Make sure that it runs OK in the issue navigator. 

If that works in the navigator and not from the script, then please share what error or problem you are getting.

Marc
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 14, 2025

Hi 

Yes i intentionally  removed Assignee ID. Ok i understand the code and will make the changes accordingly.

 

Please do reply on my 2nd Question. What if the team member by mistakely add Date Started in Time tracking as "2nd August" as shown in worklog and Start date is 5th Aug but it still shows the task start date as 2nd August in python script? How to avoid this?

Filter.png

 

 

Tuncay Senturk _Snapbytes_
Community Champion
August 14, 2025

I see! That really depends on how you’d like to handle it.

You could filter issues by Start date and exclude any work logs that fall outside the range (you’d need to add an if statement in your script for this), or you could filter issues by worklogDate directly in your JQL.

Keep in mind that an issue can have multiple work logs, and some may fall outside the target range (e.g., 1st to 31st August). For that reason, I believe it’s better to filter out the work logs in your Python script.

Suggest an answer

Log in or Sign up to answer