Hi Community,
I'm working on a vacation request form in ConfiForms and need some assistance with a few key features I can't seem to get working properly. Here's what I'm trying to achieve:
Employee Entry Fields: The form should allow employees to enter just the date-time interval (start and end) and assign a substitute. This information should be displayed in a Calendar View for easy visualization of their vacation.
Leave Days Calculation: Based on the interval, the system should automatically calculate the number of leave days and subtract it from the default annual entitlement of 30 days.
Remaining Leave Display: I want to show the remaining leave days after each vacation entry using valueView
. For example, if an employee uses 5 days, the next time they view the form, it should display their remaining leave (25 days in this case).
Dynamic Remaining Leave for Future Entries: When an employee submits another leave request, the form should dynamically calculate their remaining leave and subtract the new request from that balance, not from the default 30 days again.
Date-Time Interval Calculation: I'm currently using two separate dateTime
fields (start and end dates) because I couldn't figure out how to use a single interval field to calculate the number of days. I need a solution where the number of vacation days is computed directly from the interval. This my calculation rule:
urlaubstage=([entry.Zeitraum2.timestamp]-[entry.Zeitraum1.timestamp])/86400000+1
=> Here I Caluculate with two DateTime field but i cant show that in an intervall in calenderView. With DateTime Intervall field it is possible but i cant calculate with it.
Filtering valueView
for Remaining Leave by createdBy
: I can’t seem to filter the valueView
correctly based on the logged-in user (createdBy
) to show their remaining leave. Every user should only see their own vacation days and remaining leave.
Updating the Remaining Leave Dynamically: After a user submits a vacation request, the system should store their remaining days (calculated after subtracting the current request). This value should be used as the baseline for future vacation requests, not the default 30 days.
dateTime
fields and calculate the difference in days, but this approach feels cumbersome and error-prone.valueView
filters but haven’t had success in filtering by createdBy
and summing the total days off taken by the user.Has anyone successfully built something similar? How can I:
createdBy
) and display their remaining leave dynamically?I'd appreciate any code snippets, configuration examples, or even alternative approaches.
Thanks in advance! 😊
DateTimeInterval field in ConfiForms has handy functions to get the period between the selected dates - https://wiki.vertuna.com/display/CONFIFORMS/Accessing+field+values+and+properties
myfield.periodInSeconds
myfield.periodInMinutes
myfield.periodInHours
myfield.periodInDays
myfield.periodInWorkDays
But you can always calculate whatever you want, by accessing startDate and endDate fields of the DateTimeInterval field
Filtering by current user is possible
createdBy:[entry._user]
_user, and some other variables are always available in the context -
Alex
Hey Alex,
Thank you very much, that has solved two of my problems.
But unfortunately I think that Confiforms is not so intelligent to take values from old records and then recognise when the owner of the record is on the form to write this value as Pre Set Value in a Readonly field.
Therefore I want to make a diversion I can count the value of each user.
Example: Enrico takes 5 holiday days and another 2 holiday days
=> Confiforms ValueView = 7
Alex takes 10 holiday days and 4 holiday days => Confiforms ValueView = 14
=> so one field holiday days ._total count but filtered for each user
Is that possible?
Thanks
Enrico
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Not sure what do you mean by "not intelligent"
But you can certainly query counts and values using queryCount and queryAndAggregate
https://wiki.vertuna.com/display/CONFIFORMS/Virtual+functions
on existing records
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Enrico Mancuso
Jira doesn’t natively support advanced form calculations, but you can achieve basic tracking using custom fields and Jira automation. Here’s how to handle vacation requests using both native Jira and Smart Jira Forms, focusing on how to best use forms within issues versus shared forms.
Date Fields and Basic Calculation:
{{issue.End Date.diff(issue.Start Date).days}}
.Tracking Leave Balance:
Smart Jira Forms offers two main approaches: forms added directly to Jira issues and shared forms using the “Create Issue” feature. Each approach has unique benefits and ways to track vacation balances.
Setting Up the Form:
Auto-Attach Forms to Issues:
Using Update existing issue fields:
Tracking and Updating Vacation Days:
Form Setup and Sharing:
Using the Create issue from form submission Feature:
Central Tracking Issue for Vacation Balances:
Automation to Update the Central Tracker:
Link Requests to the Tracker(optional):
Aditional possibilities:
Analyzing Responses to Monitor Total Vacation Days Taken:
Export to external tools as Exel or PDF
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.