You may want to use The MUT found in the Mac App Store. Requires no scripting knowledge.
https://apps.apple.com/us/app/mut/id1133234759?mt=12
If you still want a scripted solution, and you are familiar with, or willing to use, ruby as your programming language, ruby-jss makes doing things like this very easy:
#!/usr/bin/env ruby
require 'ruby-jss'
require 'csv'
# This csv file contains the computers that should be in the group
# Computer names are in the first field of this csv file.
# Get the names into an array
desired_comp_names = CSV.read('/path/to/computernames.csv').map(&:first)
# connect to Jamf Pro
# you'll be prompted for the password, or it can be given with the 'connect' command
Jamf.connect 'https://apiuser@myjamfhost.jamfcloud.com'
# get the group by name
static_group = Jamf::ComputerGroup.fetch name: 'StaticGroupName'
# replace any existing membership with the desired names
static_group.members = desired_comp_names
# save your changes
static_group.save
Five lines of code, not counting the shebang and 'require' lines.
You may want to use The MUT found in the Mac App Store. Requires no scripting knowledge.
https://apps.apple.com/us/app/mut/id1133234759?mt=12
Been using MUT for a few years now, very happy with it, though I always get the "need to use classic method" verbiage and if I want to run it that way and I always say yes.
Kinda wish, I could make that the default, but either way, great program.